Go: package main

import (
	"fmt"
	"sort"
)

func main() {
	var max int

	numbers := map[int]int{}
	for {
		var a int
		_, err := fmt.Scan(&a)
		if err != nil {
			break
		}
		numbers[a]++
		if numbers[a] >= max {
			max = numbers[a]
		}
	}

	var modes []int
	for a, b := range numbers {
		if b == max {
			modes = append(modes, a)
		}
	}

	sort.Ints(modes)
	for _, mode := range modes {
		fmt.Println(mode)
	}
}

C++: #include <iostream>

int main(){
	int a,c=0,t=0;
	int b[100],f[100],z[100];
	z[0]=0;
	while(std::cin>>a){
         c++;
	    b[c]=a;
	}
	for(int g=1;g<=100;g++){
		f[g]=0;
	}
	for(int d=1;d<=c;d++){
			f[b[d]]++;
			}
	for(int g=1;g<=100;g++){
		
			if(f[g]>z[0]){
				for(int l=0;l<=t;l++){
				z[l]=0;
			}
			z[0]=g;
				t=0;
			}else if(f[g]==z[0]){
				for(int l=0;l<=t;l++){
				if(g<z[l]){
					for(int da=t;da>=l;da--){
						z[da+1]=z[da];
					}
					z[l]=g;
					
				}
				
			}t++;
		}
	}
	for(int p=0;p<=t;p++){
		std::cout<<z[p]<<std::endl;
	}
	return 0;
		}

C++: /*****include*****/
#include <iostream>
#include <fstream>
#include <string>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return 0;
	}
#endif
	/*****変数置き場*****/
	int num;
	int appear[101];
	int max;
	/*****処理部*****/
	max = 0;
	for(int i=0;i<101;i++)	appear[i] = 0;
	while(1){
		cin >> num;
		if(cin.eof())	break;
		//cin >> num;
		appear[num] += 1;
	}
	cout << endl;
	for(int i=0;i<101;i++)
		if(appear[i] > max){
			max = appear[i];
		}
	for(int i=0;i<101;i++){
		if(appear[i] == max)
			cout << i << endl;
	}
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

C++: #include <iostream>

#define SIZE 100

using namespace std;

int main() {
	int value[SIZE], n, max = 0;


	while (cin >> n) {
		value[n - 1]++;

		if (value[n - 1] > max) max = value[n - 1];
	}

	for (int i = 0; i < SIZE; i++) {
		if (value[i] == max) {
			cout << i + 1 << endl;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <vector>

int main()
{
	std::vector<int> hist(100, 0);

	int index = 0;
	int max = 0;
	while (std::cin >> index)
	{
		hist[index - 1]++;
		if (max < hist[index - 1])
		{
			max = hist[index - 1];
		}
	}

	int i = 1;
	for (const auto& h : hist)
	{
		if (h == max)
		{
			std::cout << i << std::endl;
		}
		++i;
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

int main(){
	int most, n;
	int array[101] = {0};
	most = 0;
	while(cin >> n){
		array[n]++;
		if(most < array[n]){
			most = array[n];
		}
	}
	for(int i=1; i<=100; i++){
		if(array[i] == most){
			cout << i << endl;
		}
	}
	return 0;
}