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;

const int INF = 1e+9 * 2;
double eps = 1e-10;

int main() {
	int n[128] = {0}, c = 0, maxim = 0;
	while(cin >> n[c++]);
	int cnt[128] = {0};
	for(int i = 0; i < c; ++i)
		cnt[n[i]]++;
		
	for(int i = 0; i <= 100; ++i)
		if(maxim < cnt[i])
			maxim = cnt[i];
	for(int i = 0; i <= 100; ++i)
		if(maxim == cnt[i])
			cout << i << endl;
	
	return 0;
}

C++: #include<iostream>

int main(){
  int num[101]={};
  int number,max;

  while(std::cin >> number){
    ++num[number];
  }
  max = 0;
  for(int i=1;i<101;i++){
    if(num[i]>max){
      max = num[i];
    }
  }
  for(int i=1;i<101;i++){
    if(num[i]==max){
      std::cout << i << std::endl;
    }
  }
}

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

C++: #include <iostream>

template <typename T , unsigned N>
auto findMax (T (& a) [N]) -> T
{
    auto res = a [0];
    for (auto && elem : a)
    {
        res = std::max (res , elem);
    }
    return res;
}

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

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <algorithm>

using namespace std;

int main() {
	int occurs[101];
	
	for (int i = 0; i < 101; i++) {
		occurs[i] = 0;
	}
	
	int input = -1;
	cin >> input;
	while (input >= 0) {
		occurs[input]++;
		
		input = -1;
		cin >> input;
	}
	
	int maxVal = 0;
	for (int i = 0; i < 101; i++) {
		if (occurs[i] > maxVal) maxVal = occurs[i];
	}
	
	for (int i = 0; i < 101; i++) {
		if (occurs[i] == maxVal) cout << i << endl;
	}
	
	return 0;
}

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

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

int date[101]={0};
int memo[101]={0};
int i=0;
int main(){
  int n,mc=1;
  //入力フェイズ
  while(cin >> n){
    date[n]=date[n]+1;
   // memo[i]=n;
   // i++;
    mc=max(mc,date[n]);
   // cout <<"最大値:" <<mc << endl;
   // cout << date[n] << endl;
   // cout << mc << endl;
    }
  //sort(date.begin(),date.end());
  for(int j=0;j<=100;j++){
    if(mc==date[j]){
      cout << j << endl;
    }
  }
}

C++: #include <iostream>
#include <vector>
using namespace std;
int main(){
    int n,num,max=-1,ans[101],a=0,b=0;
    vector<int>count(101,0);
    while(cin>>num){
            count[num]++;
            
        }
        for(int i=100;i>=0;i--){
            if(count[i]>max && count[i]!=0){
                b=count[i];
                max=count[i];
            }
        }
    for(int i=0;i<101;i++){
        if(count[i]==b){
            cout<<i<<endl;
        }
    }
    for(int i=0;i<a;i++){
        
    }
    return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int s = 0;
  vi t(101);
  int a;
  while (cin >> a) t[a]++, cmax(s, t[a]);
  rep(i, 101) if (t[i] == s) cout << i << endl;
}

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

using namespace std;

void solve()
{
	map<int, int> Map;
	int n;
	while(~scanf("%d", &n))
	{
		++Map[n];
	}
	int Max = 0;
	for(map<int, int>::iterator Ite = Map.begin(); Ite != Map.end(); ++Ite)
	{
		if(Max < Ite->second)
		{
			Max = Ite->second;
		}
	}
	for(map<int, int>::iterator Ite = Map.begin(); Ite != Map.end(); ++Ite)
	{
		if(Ite->second == Max)
		{
			cout << Ite->first << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
	int num;
	int bucket[101] = {0};
	int max = 0;
	
	while (scanf("%d", &num) != EOF){
		bucket[num]++;
	}
	
	for (int i = 1; i <= 100; i++){
		if (bucket[i] > max) max = bucket[i];
	}
	
	for (int i = 1; i <= 100; i++){
		if (max == bucket[i]) cout << i << "\n";
	}
	
	return (0);
}

C++: #include <iostream>

using namespace std;

int main()
{
    int n[101]={0};
    int buf;
    while(cin>>buf)
    {
        n[buf]++;
    }
    int b=0;
    for(int i=0;i<101;++i){
        if(n[i]>b)b=n[i];
    }
    for(int i=0;i<101;++i){
        if(n[i]==b)cout<<i<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main( void )
{
	vector <int> cnt( 101, 0 );
	int max_value = 0;
	while ( !cin.eof() )
	{
		int n;
		cin >> n;
		if ( cin.eof() )
			break;
		cnt[n]++;
		max_value = max( cnt[n], max_value );
	}

	for ( int i = 1; i <= 100; i++ )
	{
		if ( cnt[i] == max_value )
		{
			cout << i << endl;
		}
	}

	return 0;
}

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

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

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

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