Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

type Pair struct {
	key   int
	value int
}

func main() {
	scanner.Split(bufio.ScanWords)

	counts := map[int]int{}
	for {
		n, err := nextInt()
		if err != nil {
			break
		}

		counts[n]++
	}

	pairs := []Pair{}
	for k, v := range counts {
		pairs = append(pairs, Pair{k, v})
	}
	sort.Slice(pairs, func(i, j int) bool {
		if pairs[i].value == pairs[j].value {
			return pairs[i].key < pairs[j].key
		}
		return pairs[i].value > pairs[j].value
	})

	vMax := 0
	for _, pair := range pairs {
		if vMax != 0 && vMax != pair.value {
			break
		}
		if pair.value > vMax {
			vMax = pair.value
		}
		fmt.Println(pair.key)
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    vector<int> a(101);
    int tmp;
    int maxv = 0;
    while (cin >> tmp) {
        a.at(tmp)++;
        maxv = max(maxv, a.at(tmp));
    }

    set<int> st;
    for (int i = 1; i < 101; i++) {
        if (a.at(i) == maxv)
            st.insert(i);
    }

    for (auto a : st) {
        cout << a << endl;
    }
}

C++: #include<stdio.h>
int main(){
	int hin[101] = { 0 };
	int a,b,i,most=0;
	
	while((scanf("%d", &a))!=EOF){
		hin[a]++;
	}
	for(i=1;i<101;i++){
		if(most<=hin[i]){
			most=hin[i];
		}
	}
	for(i=1;i<101;i++){
		if(hin[i]==most){
			printf("%d\n",i);
		}
	}
		
	return 0;
}

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

int main() {
	vector<vector<int> > v(100, vector<int>(2, 0));
	for (int i = 0; i < 100; i++) {
		v.at(i).at(1) = i + 1;
	}

	int n;
	while (cin >> n) {
		v.at(n - 1).at(0)++;
	}

	sort(v.begin(), v.end());
	reverse(v.begin(), v.end());
	//cout << v.at(0).at(1) << endl;
	//cout << v.at(1).at(1) << endl;
	//cout << v.at(2).at(1) << endl;

	vector<int> v2(100);
	int max = v.at(0).at(0);
	for (int i = 0; i < 100; i++) {
		if (v.at(i).at(0) == max) {
			v2.at(i) = v.at(i).at(1);
		}
	}

	sort(v2.begin(), v2.end());
	for (int i = 0; i < 100; i++) {
		int n = v2.at(i);
		if (n) cout << n << endl;
	}
}

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



int main (int argc, char const* argv[]){
    int n,i;
    int array[100] = {};
    int max=0;
    vector<int> elems;
    
    //各整数の取得
    while((cin >> n)){
        array[n-1] += 1;
    }
    //cout << array[2]<< endl;
    
    //最頻値を求める
    for(i=0; i<100; i++){
        if(max < array[i]){
            max = array[i];
        }
    }
    //最頻値の整数全てを取得
    for(i=0;i<100;i++){
        if(max == array[i]){
            elems.push_back(i+1);
        }
    }
    
    //最頻となる整数を出力
    for(i=0;i<elems.size();i++){
        cout << elems[i] << endl;
    }
    
    return 0;
}

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

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define sz(obj) ((int)(obj).size())
#define pf push_front
#define pb push_back

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

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

#define rep(i,a,n) for(int i=a; i<n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 999999999

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long int ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int const MOD = 1000000007;

int main() {
    int a[110];
    memset(a, 0, sizeof(a));
    int n;
    int m_num = 0;
    while(cin >> n) {
        // if(n == 0) break;
        a[n]++;
        m_num = max(m_num, a[n]);
    }

    rep(i,1,101) {
        if(a[i] == m_num) cout << i << endl;
    }

    return 0;
}

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

int main() {
	vector<int> v(100, 0); int temp;
	while (cin >> temp) v[temp - 1]++;
	temp = *max_element(v.begin(), v.end());
	for (int i = 0; i < 100; i++) if (v[i] == temp) cout << i + 1 << endl;
	return 0;
}

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

using namespace std;

int main(){
	int a[101] = {0};
	int b;
	int MAX = 0;
	int i=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;
 		}
	}
	return 0;
}

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

using namespace std;

int main(){
  int input=0;
  int a[100];
  int b[100][2];
  for(int i=0;i<100;i++){
    for(int j=0;j<2;j++){
      b[i][j]=0;
    }
  }
  int n=0;
  while(cin>>input){
    a[n]=input;
    n++;
  }
  sort(a,a+n);
  int i=0,j=0;
  for(i=0;i<n;i++){
    if(i==0){
      b[0][0]=a[0];
      b[0][1]++;
    }
    else if(b[j][2]==a[i]){
      b[j][1]++;
    }
    else{
      b[++j][0]=a[i];
      b[j][1]++;
    }
  }
  int max=b[0][1];
  for(int k=0;k<=j;k++){
    if(max<b[k][1]){
      max=b[k][1];
    }
  }
  int out[100];
  int m=0;
  for(int k=0;k<=j;k++){
    if(max==b[k][1]){
      out[m]=b[k][0];
      m++;
    }
  }
  for(int p=0;p<m;p++){
    cout<<out[p]<<"\n";
  }
  return 0;
}

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

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

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>

typedef long long ll;
using namespace std;

typedef pair<int,int> P;

int main()
{

	int a;
	map<int,int> num;
	queue<int> que;
	while(~scanf("%d",&a)){
		num[a]++;
	}

	int max_freq = -1;

	for(map<int,int>::iterator it; it != num.end(); it++){
		if(it->second == max_freq){
			que.push(it->first);
		}
		else if(it->second > max_freq){
			while(!que.empty()){
				que.pop();
			}
			max_freq = it->second;
			que.push(it->first);
		}
		
	}

	while(que.empty()){
		cout << que.front() << endl;
		que.pop();
	}

}

C++: #include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <climits>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;

int ary[105];
int main() {
    int a;
    while(cin>>a) {
        ary[a]++;
    }
    int maxi = max_element(ary,ary+105);
    rep(i,105) {
        if(maxi==ary[i]) {
            cout<<i<<endl;
        }
    }
    return 0;
}

C++: #include <stdio.h>

#define EOF (-1)

int main(void)
{
	int number[100];
	int i=0;
	int judge_eof;
	int qty;
	int count[100];
	
	//count???0??§?????????
	for(i=0;i<100;i++)
	{
		count[i] = 0;
	}
	
	for(i=0;i<100;i++)
	{
		judge_eof = scanf("%d",&number[i]);
		
		i++;
		
		if(judge_eof == EOF)
		{
			goto OUT;
			qty = i;
		}
	}
	
	OUT:
	
	for(i=0;i<qty;i++)
	{
		count[number[i]]++;
	}
	
	return 0;
}