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 <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;
		}
	}
}

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;
}