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>
using namespace std;
int main() {
  int a[100] = {}, m, i, n;
  while (cin >> n) {
    a[n - 1]++;
  }
  for (i = m = 0; i < 100; i++) {
    if (a[i] > m) {
      m = a[i];
    }
  }
  for (i = 0; i < 100; i++) {
    if (a[i] == m) {
      cout << i + 1 << endl;
    }
  }
  return 0;
}

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

/** Problem0028 : Mode Value **/
int main()
{
	int num[101] = {0}, max=0, input;
	while (cin >> input) {
		if (++num[input] > max)
			max = num[input];
	}
	for (int i=0; i<101; i++) {
		if (num[i] == max)
			cout << i << endl;
	}
	return 0;
}

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

using namespace std;

int main(){
	int num, max;
	int list[100] = {0};
	
	max = 0;

	while (scanf("%d", &num) != EOF){
		list[num - 1]++;
	
		for (int i = 0; i < 100; i++){
			if (max < list[i]){
				max = list[i];
			}
		}
		for (int j = 0; j < 100; j++){
			if (max == list[j]){
				printf("%d\n", j + 1);
			}
		}
	}
	return 0;
}

C++: //0028 Mode Value
//1`100ÌlªÅå100ñ^¦çêé
//ÅplðoÍ¹æ@¡ÌÅplª éêÍA¬³¢ÉoÍ¹æ

#include<iostream>
#include<algorithm>
#include<limits>
using namespace std;

int main(void)
{
	const int N = 100;
	int a[N+1] = {};
	int i;
	while( cin >> i )
		a[i]++;

	int maxMode = numeric_limits<int>::min();
	for(i = 1; i <= N; i++)
		maxMode = max(maxMode, a[i]);
	for(i = 1; i <= N; i++)
	{
		if(a[i] == maxMode)
			cout << i << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <map>
using namespace std;
int main(){
	int n;
	map<int, int> cnt;
	int maxCnt = 0;
	while(cin >> n){
		cnt[n]++;
		maxCnt = max(maxCnt, cnt[n]);
	}
	for(map<int,int>::iterator itr = cnt.begin(); itr != cnt.end(); itr++){
		if(maxCnt == itr->second){
			cout << itr->first << endl;
		}
	}

	return 0;
}

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

using namespace std;

int main() {
  int n, mx = 0;
  map<int, int> m;
  while (cin >> n) ++m[n];
  for (auto i : m) mx = max(mx, i.second);
  for (auto i : m) {
    if (i.second == mx) cout << i.first << endl;
  }
}

C++: #include<cstdio>

using namespace std;

int main(void){
	int in[100],data[100],ans[100],cnt,work=0;
	int i,j;	//ループカウンタ

	for(i=0;i<100;i++)	ans[i]=0;
	for(i=0;i<100;i++)	in[i]=0;

	for(i=0;i<100;i++){
		if(scanf("%d",&data[i])==EOF)	break;	//EOF=Ctrl+z
		in[data[i]]++;
	}
	
	for(i=1;i<100;i++)
		if(in[work]<in[i])	work=i;
	
	ans[0]=work;
	cnt=0;
	for(i=1;i<100;i++){
		if(in[work]==in[i] && i!=work){
			cnt++;
			ans[cnt]=i;
		}
	}

	for(i=0;i<=cnt-1;i++){
		for(j=1;j<=cnt;j++){
			if(ans[i]>ans[j]){
				work=ans[i];
				ans[i]=ans[j];
				ans[j]=work;
			}
		}
	}
	
	for(i=0;i<=cnt;i++)
		printf("%d\n",ans[i]);

	return 0;
}

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

int main(){
	int a[110], i=1, b[110];
	vector<int> ans;
	for(int i=0 ; i<110 ; i++){
		b[i] = 0;
	}

	while(cin >> a[i]){
		if(i==100)break;

		b[ a[i] ]++;
	}
	int num = 0;
	for(int i=1 ; i<=100 ; i++){
		if( num < b[i] ){
			ans.clear();
			num = b[i];
			ans.push_back(i);
		}
		else if( num == b[i] ){
			ans.push_back(i);
		}
	}

	sort( ans.begin() , ans.end() );
	for(int i=0 ; i<ans.size() ; i++){
		cout << ans[i] << endl;
	}
	return 0;
}

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

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

C++: #include <iostream>
#include <map>
#include <algorithm>
#include <stdio.h>
#include <string.h>

using namespace std;

int ok, arr[100];

int main(void) {
    memset(arr, 0, sizeof(arr));
    while(~scanf("%d", &ok)) {
        arr[ok] += 1;
    }
    int mx = *max_element(arr, arr + 100);
    for(int i = 0; i < 100; i++) {
        if(arr[i] == mx) {
            printf("%d\n", i);
        }
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main ( void )
{
	int x;
	unsigned int mx = 0, data[101] = { 0 };

	while (cin >> x)
	{
		++data[x];
		mx = max( mx, data[x] );
	}

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

	return 0;
}

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

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int num[110] = {0};
  int max = 0;
  vector<int> maxnum;
  int n;
  while(cin>>n){
    num[n]++;
    if(num[n] > max){
      maxnum.clear();
      maxnum.pb(n);
      max = num[n];
    }else if(num[n] == max){
      maxnum.pb(n);
    }
  }
  sort(all(maxnum));
  rep(i,maxnum.size())cout<<maxnum[i]<<endl;

}

C++: #include <iostream>

using namespace std;

int main(void){

  int array[102];
  int n;
  for( int i = 0 ; i <= 101 ; i++ )array[i] = 0;

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

  int yano = 0;
  for( int i = 1 ; i <= 100 ; i++ ){
    yano = max( array[i] , yano );
  }

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

  return 0;
}

C++: #include <stdio.h>
#include <string.h>

int i, n, max;
int m[101];

int main(void)
{
  memset(m,0,sizeof(m));
  while(scanf("%d",&n) == 1)
    m[n]++;

  max = 0;
  for(i = 1; i <= 100; i++)
     if (m[i] > max) max = m[i];

  for(i = 1; i <= 100; i++)
    if (m[i] == max) printf("%d\n",i);
  return 0;
}

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

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

C++: #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
	int counter[200],m;
	memset(counter, 0, sizeof(counter));
	int i;
	while (cin >> i)
		counter[i]++;
	for (int i = 0; i < 200; i++)
		m = max(counter[i], m);
	for (int i = 0; i < 200; i++)
	{
		if (counter[i] == m)
			cout << i << endl;
	}
}