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 <iostream>

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

C++: #define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#include <bits/stdc++.h>
using namespace std;
int main(){
  int x;
  int vec[100]={0};
  while(cin>>x){
    vec[x]++;
  }
  int ma=0;
  rep(i,100){
    ma = max(ma,vec[i]);
  }
  rep(i,100){
    if(vec[i]==ma) cout<<i<<endl;
  }
      
  return 0;
}

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

using namespace std;

int main(){
vector<int> data(101,0);
int v;
while(scanf("%d",&v)!=-1)data[v]++;
int mxvl=0;
vector<int> res;
for(int i=0;i<=100;++i){
if(mxvl < data[i]){
mxvl = data[i];
res.clear();
}
if(mxvl == data[i])res.push_back(i);
}
for(int i=0;i<res.size();++i)printf("%d\n",res[i]);
return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
#include<map>
using namespace std;

int main(){
    int mod=1000000007;
    int n,tmp=0;
    int a[101]={0};
    while (scanf("%d",&n)!=EOF) {
        a[n]+=1;
        tmp=max(tmp,a[n]);
    }
    for (int i=1;i<101;i++) {
        if (a[i]==tmp) {
            printf("%d\n",i);
        }
    }
    return 0;
}

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

using namespace std;

int main(){
    vector<int>Times(101,0);
    int x;
    while(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 <stdio.h>

int main(void) {
  int i, j, k, n, ans[101], max = 0;
  for(i = 0; i < 101; ++i) ans[i] = 0;
  while(scanf("%d", &n) != EOF) {
    ++ans[n];
  }
  for(i = 1; i < 101; ++i) if(max < ans[i]) max = ans[i];
  for(i = 1; i < 101; ++i) if(ans[i] == max) printf("%d\n", i);
  return 0;
}

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

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

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

using namespace std;

int main()
{
	int i,j;
	int num[100]={0};
	int a;
	int max=0;
	vector<int> ans;
	
	for(i=0;cin >> a;i++)
	{
		num[a]++;
		
		for(j=0;j<i;j++)
		{
			if(num[j]>max)
			{
				max=num[j];
			}
		}
	}
	
	for(j=0;j<i;j++)
		if(num[j]==max)
			ans.push_back(j);
		vector<int>::iterator it = ans.begin();
	for(;it!=ans.end();++it)
		cout << *it << endl;
}

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

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

using namespace std;

int main()
{
#if 1
	int a[101] = {0};
	int v;

	// 数え上げ
	while (cin >> v) {
		a[v]++;
	}

	// 最大値を求める
	int max = 0;

#if 0
	// autoが使えるとき
	for (auto x : a) {
		if (x > max) {
			max = x;
		}
	}
#else
	for (int i = 1; i <= 100; i++) {
		if (a[i] > max) {
			max = a[i];
		}
	}
#endif

	// 最大値になった数（添え字）を表示
	for (int i = 1; i <= 100; i++) {
		if (a[i] == max) {
			cout << i << endl;
		}
	}

#else
	map<int, int> a;
	int v;

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

	// 最大値を求める
	int max = 0;
	for ( auto x : a ) {
		if (x.second > max) {
			max = x.second;
		}
	}

	// 最大値を取る値を出力
	vector<int> answer;
	for ( auto x : a ) {
		if ( x.second == max) {
			answer.push_back(x.first);
		}
	}

	// 並べ替え
	sort(answer.begin(), answer.end());
	for ( auto x : answer ) {
		cout << x << endl;
	}

#endif

	return 0;
}

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

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

int main(){
  int tmp;
  vector<int> v(101,0);
    
  while(cin>>tmp){
    ++v[tmp];
  }

  int max_=0;

  for(int i=0;i<101;++i)
    max_ = max(max_,v[i]);

  for(int i=0;i<101;++i){
    if(v[i]==max_)
      cout<<i<<endl;
  }
  return EXIT_SUCCESS;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a[105] = {},b,c=0;
	while (cin >> b){
		a[b]++;
	}
	for (int i = 0; i < 101; i++){
		if (c < a[b]){
			c = a[b];
		}
	}
	for (int i = 0; i < 101; i++){
		if (a[b] == c)cout << b << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

int main(){
	vector<pair<int,int> > kanri;
	int n,tmpmax;
	bool flag;

	while(cin >> n){
		flag = false;

		if(kanri.empty()){
			kanri.push_back(pair<int,int>(n,1));
			tmpmax = 1;
		}
		else{
			for(vector<pair<int,int> >::iterator it = kanri.begin(); it != kanri.end(); it++){
				if(it->first == n){
					it->second++;
					if(tmpmax < it->second){
						tmpmax = it->second;
					}
					flag = true;
					break;
				}
			}
			if(flag == false){
				kanri.push_back(pair<int,int>(n,1));
				sort(kanri.begin(),kanri.end());
			}
		}
	}

	for(vector<pair<int,int> >::iterator it = kanri.begin(); it != kanri.end(); it++){
		if(it->second == tmpmax){
			cout << it->first << endl;
		}
	}
	

	return 0;
}

C++: #inlcude <stdio.h>

int main(){
    int d[100];
    int maximize[100];

    int buf;
    while( scanf( "%d",&buf ) != EOF  ) d[buf-1]++;

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

    for( int i = 0;i < 100;i++ ){
        if( d[i] >= buff ) printf( "%d\n",i+1 );
    }
    return 0;
}

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

int c[100];

int main()
{
	int a;
	
	while( std::cin >> a ){
		c[a-1]++;
	}
	
	int c_max = 0;
	for( int i = 0; i < 100; i++ ){
		c_max = std::max( c_max, c[i] );
	}
	
	for( int i = 0; i < 100; i++ ){
		if( c[i] == c_max ){
		 	std::cout << i + 1 << std::endl;
		}
	}

 	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void)
{
    int n;
    int ans[100]={0};
    int kari;
    
    while(cin>>n)
        ans[n]++;
    
    kari=ans[0];
    for(int i=1;i<99;i++)
    {
        if(kari<ans[i])
            kari=ans[i];
    }
    
    for (int i=0; i<100; i++)
    {
        if(kari==ans[i])
            cout<<i<<endl;
    }
    
    return 0;
}