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 <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = {-1,0,1,0}; const int dy[] = {0,1,0,-1};

int main() {
int a[100]={0};
int n;
while(cin>>n){
a[n-1]++;
}
int ma=0;
REP(i,100){
ma=max(ma,a[i]);
}
REP(i,100){
if(a[i]==ma)
cout<<(a[i]+1)<<endl;
}
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    vector<int> num(101, 0);
    int maxNum = 0;

    for(;;){
        int a;
        if(!(cin >> a))
            break;
        maxNum = max(maxNum, ++num[a]);
    }

    for(int i=1; i<=100; ++i){
        if(num[i] == maxNum)
            cout << i << endl;
    }
}

C++: #include<iostream>
int main(){int l[99],i,f;for(i=0;i<99;i++)l[i]=0;while(std::cin>>i)l[i-1]++;for(i=0,f=0;i<99;i++)if(f<l[i])f=l[i];for(i=0;i<99;i++)if(l[i]==f)std::cout<<i+1<<"\n";}

C++: #include <iostream>
#include <math.h>

using namespace std;

int main(){
	int a[101] = {0};
	int b;
	int MAX = 0;

	while(cin >> b){
		a[b]++;
	}
	for(int j=1; j<101; i++){
		MAX = max(MAX, a[j]);
	}
	for(int m=1; m<101; m++){
		if(MAX == a[m]){
			cout << m << endl;
 		}
	}
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
	int n[100] = {};
	int t;
	while(cin >> t){
		n[t - 1]++;
	}
	int m = 0;
	for(int i = 0; i < 100; i++){
		m = max(m,n[i]);
	}
	for(int i = 0; i < 100; i++){
		if(n[i] == m){
			cout << i + 1 << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n;
	int a[100]={0};
	while(cin>>n){
		a[n-1]++;
	}
	int b=0;
	for(int i=0;i<100;i++){
		if(a[i]>b) b=a[i];
	}
	for(int j=0;j<100;j++){
		if(a[j]==b) cout<<j+1<<endl;
	}
	return 0;
}

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

int main(void){
	int n, m=0, d[101]={0};

	while (cin>>n) 	d[n]++;
	for (int i=0; i<101; i++) if (d[i]>m) m=d[i];
	for (int i=0; i<101; i++) if (d[i]==m) cout<<i<<endl;

	return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>

int compareq(const void*a, const void*b)
{
	return *(int*)a > *(int*)b ? 1 : *(int*)a == *(int*)b ? 0 : -1;
}

int main()
{
	int numbers[101], i = 0, maxnum[101];
	while (scanf("%d", &numbers[i]) != EOF)i++;
	qsort(numbers, i, sizeof(int), *compareq);
	int n, cnt = 0, max = 0, j = 0;
	for (n = 0; n < i; n++)
	{
		if (numbers[n] == numbers[n - 1])cnt++;
		else
		{
			if (cnt > max)
			{
				int s = 0;
				while (1)
				{
					maxnum[s++] = 0;
					if (s == 100)break;
				}
				maxnum[0] = n - 1;
				max = cnt;
				cnt = 0;
				j = 0;
			}
			else if (cnt == max)
			{
				maxnum[j++] = n - 1;
				cnt = 0;
			}
			else;
		}
	}
	j = 0;
	while (maxnum[j] != 0)
	{
		printf("%d\n", maxnum[j]);
		j++;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
	int t[102]={},tmp,k = 0,i;
	while(cin>>tmp){
		t[tmp+1]++;
		if(t[tmp+1]>k){
			k = t[tmp+1];
		}
	}
	for(i = 1;i <= 102;i++){
		if(t[i] == k){
			cout<<i-1<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>

#define ll (long long)
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

/*thief??????*/

int main(void){
    
    int input[120] = {0};
    int c  = 1;
    int check[100] = {0};
    int asnwer[100] = {0};
    int max = 0;
    while(cin >> input[c++])
    {
        int temp = input[c-1];
        check[temp]++;
    }
    REP(i, c)
        if(max <= check[i])
            max = check[i];
    
    REP(i,c) if(check[i] == max) cout << i << endl;
    return 0;
        }

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 1000000
using namespace std;
int main(){
    vector<int> vec(101);
    rep(i,101) vec[i] = 0;
    int n,tmp=0;
    vector<int> ans;
    while(cin >> n){
        vec[n]++;
    }
    rep(i,vec.size()){
        if(tmp <= vec[i]) tmp = vec[i];
    }
    rep(i,vec.size()){
        if(tmp == vec[i]) ans.push_back(i);
    }
    sort(ans.begin(),ans.end());
    rep(i,ans.size()) cout << ans[i] << endl;
    return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
int main()
{
	
		int n,a;
		vector<int>number;
		int c[101] = { 0 };
		for (int i = 0; i<100; i++){
			cin >> a;
			c[a]++;
		}
		int max = 1;
		for (int i = 1; i <= 100; i++){ 
			if (max == c[i]){
				number.push_back(i);
			}
			else if (max<c[i]){
				max = c[i];
				number.clear();
				number.push_back(i);
			}
			
		}
		for (int i = 0; i < number.size(); i++){
			cout << number[i] << endl;
		}
}

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

int main()
{
	int i,n,max=0;
	int count[101]={0};

    while(cin >> n){
		if(cin.eof()){break;}
		count[n]++;  //count[n]の個数を数える
		if(max<count[n]){  //最頻値maxをcount[n]の個数が超えたときmaxを更新
			max=count[n];
		}
	}
	for(i=1;i<101;i++){  //count[i]の値がmaxのとき出力
		if(max==count[i]){
			cout << i << endl;
		}
	}
	return 0;
}

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

using namespace std;

int main() {
	int mode[100];
	int a, v = 0;

	memset(mode, 0, sizeof(mode));
	while (cin >> a) {
		mode[a-1] += 1;
	}
	for (int i = 0; i < 100; i++)
		v = max(v, mode[i]);
	for (int i = 0; i < 100; i++)
		if (mode[i] == v)
			cout << i+1 << endl;
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){
	int n;
	int a[101]={0};

	while(cin>>n){
        a[n]++;
	}
	int b=0;
    for(int i=0;i<100;i++){
        b=max(a[i],b);
    }
    for(int i=0;i<100;i++){
        if(a[i]==b)cout<<i<<endl;
    }
	return 0;
}

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

using namespace std;

int main() {

	int n, max=0, s[100];

	for(int i=0; i<100; i++) {
		s[i]=0;
	}

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

	for(int i=0; i<100; i++) {
		if(s[i]>max)
			max=s[i];
	}

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

	return 0;

}