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 <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define FOR(x,a,b) for(int x=a;x<b;x++)
#define REP(x,b) for(int x=0;x<b;x++)
#define FORSIZE(x,A) for(int x=0;x<A.size();x++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define SORT(x) sort(x.begin(),x.end())
#define RSORT(x) sort(x.rbegin(),x.rend())
#define rsort(x,n) sort(x, x+n, greater<int>())
#define REV(x) reverse(x.begin(),x.end())
using namespace std;
typedef long long ll;
inline int toInt(std::string s) {int v; std::istringstream sin(s);sin>>v;return v;}
template<class T> inline std::string toString(T x) {std::ostringstream sout;sout<<x;return sout.str();}

int main( int argc, const char* argv[] )
{
    int a[101];
    int tmp;
    int c = 0;
    int m = 0;
    fill(a, a+101, 0);
    while (cin >> tmp) {
        a[tmp] += 1;
        m = max(m, a[tmp]);
        c += 1;
    }
    FOR(i, 0, 101) {
        if (a[i] == m) {
            cout << i << endl;
        }
    }
    return 0;
}

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

using namespace std;

int main(){
    vector<int>Times(101,0);
    int x;
    while(cin >> x){
      cin>>x;
      Times[x]+=1;
    }
    
    int ma =-1;
    for(int x=1; x<=100; x++){
        if(ma<Times[x]) ma=Times[x];
    }
     
    for(int x=1; x<=100; x++){
        if(Times[x] == ma) cout << x << endl;
    } 
    return 0;
}

C++: #include <iostream>

#define SIZE 100

using namespace std;

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


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

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

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

	return 0;
}

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;
		z[g]=0;
	}
	for(int d=1;d<=c;d++){
			f[b[d]]++;
			}
			
	for(int g=1;g<100;g++){
		
			if(f[g]>z[0]){
			
			z[0]=g;
				t=0;
			}else if(f[g]==z[0]){
				t++;
				z[t]=g;
		}
	}
	
	for(int p=0;p<t;p++){
		std::cout<<z[p]<<std::endl;
	}
	return 0;
		}

C++: #include <stdio.h>

int main(void)
{
	int i, j = 0;
	int num[10];
	int n[100];
	int max;
	
	for (i = 0; i < 10; i++){
		num[i] = 0;
	}
	
	i = 0;
	
	while ( scanf("%d", &n[i]) != EOF){
		
		switch (n[i]){
			case 0:
			num[0]++;
			break;
			
			case 1:
			num[1]++;
			break;
			
			case 2:
			num[2]++;
			break;
			
			case 3:
			num[3]++;
			break;
			
			case 4:
			num[4]++;
			break;
			
			case 5:
			num[5]++;
			break;
			
			case 6:
			num[6]++;
			break;
			
			case 7:
			num[7]++;
			break;
			
			case 8:
			num[8]++;
			break;
			
			case 9:
			num[9]++;
			break;
		}
		i++;
	}
	
	max = num[0];
	
	for (i = 1; i < 10; i++){
		if (max < num[i]){
			max = num[i];
		}
	}
	for (j = 0; j < 10; j++){
		if (max == num[j]){
			printf("%d\n", j);
		}
	}
	
	return (0);
}

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

int main(){
  int n;
  int value[101]={},a=0;

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

  for(int i=0;i<101;i++){
    if(value[i]>a){
      a=value[i];
    }
  }

  for(int i=0;i<101;i++){
    if(value[i]==a){
      cout << i << endl;
    }
  }

}

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

int main() {
	int a[101] = {},i = 1,max = 0,tmp;

	while (cin >> tmp) {
		a[tmp]++;
		i++;
	}

	for (int j = 1; j < 100; j++) {
		if (a[j] > max) {
			max = a[j];
		}
	}

	for (int j = 1; j < 100; j++) {
		if (a[j] == max) {
			cout << j << endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> cnt(110,0);
    vector<int> ans;
    int n; 
    while(cin>>n){
        cnt[n]++;
    }
    int y=0;
    for(int i=1; i<=100; i++){
        y=max(y,cnt[i]); 
    }
    for(int i=1; i<=100; i++){
        if(cnt[i]==y) ans.emplace_back(i);
    }
    for(auto& a: ans){
        cout<<a<<endl;
    }

    return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a[101] = {0};
	int input;
	while(cin >> input){
		a[input]++;
	}
	int m = 0;
	for(int i = 1; i < 101; i++){
		if(m < a[i]) m = a[i];
		//m = max(m, a[i]);
	}
	for(int i = 1; i < 101; i++){
		if(m == a[i]){
			cout << i << endl;
		}
	}
	return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cassert>

using namespace std;


bool solve(){
	vector<vector<int> > a(100, vector<int>(2, 0));
	for(int i=0;i<100;i++){
		a[i][0] = i;
	}
	int n;
	while(cin>>n){
		a[n][1]++;
	}
	for(int i=0;i<100-1;i++){
		for(int j=i;j<100;j++){
			if(a[i][1] < a[j][1]){
				swap(a[i][0],a[j][0]);
				swap(a[i][1],a[j][1]);
			}
		}
	}
	int hoge=0;
	while(1){
		cout<< a[hoge][0]<< endl;
		if(a[hoge][1]!=a[hoge+1][1] || hoge==99) break;
		hoge++;
	}
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}