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>
#include<map>

using namespace std;

int data[105]={0};
int main(){
	int x;
	int ma=0;
	while(cin>>x){
		data[x]++;
		ma=max(data[x],ma);
	}
	for(int i=0;i<105;i++){
		if(data[i]==ma)cout<<i<<endl;
	}
	
}

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

using namespace std;

int bucket[101];
int ma = 0;

int main()
{
	int a;
	
	memset(bucket, 0, sizeof(bucket));
	
	while(cin>>a, !cin.eof())
	{
		bucket[a]++;
		ma = max( bucket[a], ma);
	}
	
	for( int i = 0; i < 101; i++)
	{
		if(bucket[i] == ma)
			cout << i << endl;
	}
	
	
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int t=0,bell=0,hess=0,number[100]={0};
  while(cin >> bell){
    t++;
    number[bell]++;
  }
  for(int i=0;i<t;i++){
    if(number[i]>hess){
      hess=number[i];
    }
  }
  for(int i=0;i<t;i++){
    if(number[i]>=hess){
      cout << i << endl;
    }
  }
}

C++: #define _USE_MATH_DEFINES
 
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

int main(){
	int data[101]={0};
	int max = 0;

	int d;
	while(cin >> d){
		data[d]++;
		if(data[d]>max){
			max=data[d];
		}
	}

	for(int i=1;i<101;i++){
		if(data[i]==max){
			cout << i << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>

#define N 100

int main(void){
    int times[N];
    int n, maxtm=0;
    
    for (int i=0; i<N; i++) times[i]=0;
    while (scanf("%d", &n)!=EOF){
        times[n]++;
        if (times[n] > maxtm) maxtm = times[n];
    }
    for (int i=0; i<N; i++){
        if (times[i]==maxtm) printf("%d\n", i);
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
map<int,int> Map;
signed main(void){
	ios::sync_with_stdio(false);
	int x,maxn=0;
	while(cin>>x)
		Map[x]++;
	for(map<int,int>::iterator it=Map.begin();it!=Map.end();it++)
		maxn=max(maxn,it->second);
	for(map<int,int>::iterator it=Map.begin();it!=Map.end();it++)
		if(it->second==maxn)
			cout<<it->first<<endl;
}

C++: #include <iostream>

using namespace std;

int main(void){
	int times[10];
	int i, n;
	int max;

	for(i=0;i<10;i++){
		times[i] = 0;
	}

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

	max = 0;
	for(i=0;i<10;i++){
		if(max < times[i]){
			max = times[i];
		}
	}

	for(i=0;i<10;i++){
		if(max == times[i]){
			cout << i << endl;
		}
	}
	return 0;
}

C++: #include <cstdio>

using namespace std;

int a[100],mp[101] = {0};

signed main()
{
    int key, j = 0;
    while ( scanf("%d\n", &key ) != EOF )
    {
        mp[ key ]++;
    }
    int mode_value = 0;
    for( int i = 1; i <= 100; i++ )
    {
        if( mode_value < mp[i] )
        {
            mode_value = mp[i];
        }
    }
    
    for( int i = 1; i < 100; i++ )
    {
        if( mp[i] == mode_value )
        {
            printf( "%d\n", i + 1 );
        }
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<ll,ll> P;
const ll MOD=1234567;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-3;
int dx[4]={0,1,0,1};
int dy[4]={0,0,1,1};
vector<int> ans[110];
int main(){
    int a[110];
    int id=0;
    int c[110]={};
    while(cin>>a[id]){
        c[a[id]]++;
        id++;
    }
    for(int i=1;i<=100;i++){
        ans[c[i]].push_back(i);
    }
    for(int i=100;i>=1;i--){
        if(ans[i].size()!=0){
            for(int j=0;j<ans[i].size();j++){
                cout<<ans[i][j]<<endl;
            }
            return 0;
        }
    }
    return 0;
}

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

using namespace std;

int d[100];
int m;

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

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

using namespace std;

int main() {

	int counter[9];
	int a[100];
	int MAX = 0;
	int i = 0;
	
	while (cin >> a[i]) {
		counter[a[i] + 1]++;
		i++;
	}

	for (int j = 0; j < 9; j++) {
		MAX = max(MAX, a[j]);
	}

	for (int k = 0; k < 9; k++) {
		if (MAX == a[k]) {
			cout << a[k] << endl;
		}
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  string s;
  map<int, int> mp;
  set<int> st;
  int mx = 0;
  while (getline(cin, s)) {
    int a = stoi(s);
    mp[a]++;
    if (mp[a] == mx) {
      st.insert(a);
    } else if (mp[a] > mx) {
      mx = mp[a];
      set<int>().swap(st);
      st.insert(a);
    }
  }
  for (int e : st) {
    cout << e << '\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; j++){
		MAX = max(MAX, a[j]);
	}
	for(int m=1; m<101; m++){
		if(MAX == a[m]){
			cout << m << endl;
 		}
	}
}

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

int main(){
	int poyo[101] = { 0 };
	int input;
	int max = 0;
	int i;
	while (scanf("%d",&input)!=EOF){
		poyo[input]++;
		if (max < poyo[input]) max = poyo[input];
	}

	for (i = 1; i < 101; i++){
		if (max == poyo[i]){
			cout << i << endl;
		}
	}

	return 0;
}

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

int main()
{
	int count[101] = {};
	int n;
	int Max = 0;

	while (cin >> n)
	{
		count[n]++;
	}
	for (int i = 1; i <= 100; i++)
	{
		Max = max(Max, count[i]);
	}
	for (int i = 1; i <= 100; i++)
	{
		if (count[i] == Max) cout << i << endl;
	}

	return 0;
}

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

int main(){

  int i, a[N];
  while(cin >> i) a[i]++;

  int max = a[1];

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

  for(int k = 1; k < N; k++){
    if(a[k] == max)
      cout << k << "\n";
  }
}

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

using namespace std;
int main(){
	int a[101]={0},n=0,saidai[100]={0},m=0;
	while(cin>>n){
		a[n]++;
	}
	for(int i=1;i<101;i++){
		if(saidai[m]<a[i]){
			for(int x=0;x<=m;x++){
				saidai[x]=0;
				m=0;
			}
			saidai[m]=i;
		}
		else if(saidai[m]==a[i]){
			saidai[m+1]=saidai[m];
			saidai[m]=i;
			m++;
		}
	}
	sort(saidai,saidai+100);
	for(int i=0;i<=100;i++){
		if(saidai[i]!=0){
			cout<<saidai[i]<<endl;
		}
	}
}