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 <iostream>
#include <cstdio>

using namespace std;

int hindo[100];

int main()
{
  int n;
  while (scanf("%d ", &n) == 1) {
    hindo[n - 1]++;
  }
  
  int mx = 0;
  for (int i = 0; i < 100; i++) {
    mx = max(hindo[i], mx);
  }
  for (int i = 0; i < 100; i++) {
    if (mx == hindo[i]) {
      printf("%d\n", i + 1);
    }
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main(){

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	int n, max=0, ans[100];
	vector<int> s;
	for(int i=0; i<100; i++)
		ans[i] = 0;
	while(cin >> n){
		if(n > 100 || n < 1) return 0;
		s.push_back(n);
	}
	sort(s.begin(), s.end());
	vector<int>::iterator it = s.begin();
	while(it != s.end()){
		ans[*it-1]++;
		it++;
	}
	for(int i=0; i<100; i++)
		if(max < ans[i]) max = ans[i];
	for(int i=0; i<100; i++)
		if(max == ans[i]) cout << i+1 << endl;
}

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

#define ll long long
#define LL long long
#define ULL unsigned long long 
#define ull unsigned long long 
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);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 int(x) int x;scanf("%d",&x);
#define double(x) double x;scanf("%lf",&x);
#define string(x) double string;cin>>x;

using namespace std;

int main()
{
	int num;
	int data[100]={};
	int ans;
/*	for (int j = 0; j < 100; j++) {
		data[j] = j;
	}*/
	int i=0;
	
	while (cin >> num)
	{
		data[num]++;
		i++;
	}
	int tmp = 0;
	//sort(num, num + i);
	for (int j = 0; j < i; j++) {
		if (data[j] > tmp)
		{
			ans = j;
			tmp = data[j];
		}
	}

	cout << ans << endl;

	for (int j = 0; j < i; j++) {
		if (data[ans]==data[j]&&j!=ans)
		{
			cout << j << endl;
		}
	}


	return 0;
}

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

int main(void){
  int memo[101] = {0};
  int n, max = 0;

  while(cin >> n)
    memo[n]++;

  for(int i = 0; i < 101; i++)
    if(max < memo[i])
      max = memo[i];

  for(int i = 0; i < 101; i++)
    if(memo[i] == max)
      cout << i << endl;

  return 0;
}

C++: import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		int cnt[] = new int[100];
		
		while (input.hasNext()){
			int n = input.nextInt();
			cnt[--n]++;
		}
		
		int max = 0;
		for (int n : cnt){
			if (max < n){
				max = n;
			}
		}
		
		for (int i = 0; i < cnt.length; i++){
			if (cnt[i] == max){
				System.out.println(i + 1);
			}
		}
	}
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <functional>
#include <sstream>
#include <complex>
#include <climits>
using namespace std;

#define REP(i,a,n) for(int i=(a);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define EPS 1e-8

bool cmp(pair<int,int> a, pair<int,int> b){
	if( a.second == b.second ) return a.first < b.first;
	return a.second > b.second;
}
int main(){
	map<int,int> mii;
	vector<pair<int,int> > vp;
	int n;
	while(~scanf("%d",&n)){
		mii[n]++;
	}
	map<int,int>::iterator it;
	for(it=mii.begin(); it!=mii.end(); it++)vp.push_back(*it);
	sort(vp.begin(), vp.end(), cmp);
	int i;
	for(i=1; i<vp.size() && vp[i].second==vp[i-1].second; i++);
	rep(j,i)printf("%d\n",vp[j].first);
	/*
	rep(j,vp.size()){
		printf("%d %d\n",vp[j].first, vp[j].second);
	}
	*/
	return 0;
}

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

int main(){
   int n, m = 0;
   int a[101];
   vector<int> ans;

   for(int i=1 ; i <= 100 ; i++){
       a[i] = 0;
   }
   while( cin >> n ){
       a[n]++;
   }
   for(int i=1 ; i <= 100 ; i++){
       m = max( a[i] , m );
   }
   for(int i=1 ; i <= 100 ; i++){
       if( m == a[i] ) ans.push_back(i);
   }
   sort( ans.begin() , ans.end() );
   for(int i=0 ; i < ans.size() ; i++ ){
       cout << ans[i] << endl;
   }
}

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

int num[101];
int big = 0;
int input;
int main(){
	for(int i=0; i <= 101; i++) num[i]=0;
	while(scanf("%d", &input) != EOF) num[input]++;
	for(int i=0; i <= 100; i++) big = max(big, num[i]);
	for(int i=0; i <= 100; i++) if(num[i] == big) cout << i << endl;
}

C++: #include<iostream>
using namespace std;
int main(){
  int count[100];
  int b;
  int ans[100];
  int ans2[100];
  int ans3;
  ans3 = 0;
  for(int i=0;i<100;i++){
    ans[i] = 0;
    ans2[i] = 0;
    count[i] = 0;
  } 
  while(cin>>b) count[b-1]++;
  for(int i=0;i<100;i++){
    if(ans[ans3]<count[i]){
      ans[i] = count[i];
      ans2[i] = i + 1;
      ans3 = i;
      for(int k=0;k<100;k++) if(k!=i) ans2[k] = 0;    
    }
    else if(ans[ans3]==count[i]&&ans3!=0) ans2[i] = i + 1;
  }
  for(int i=0;i<100;i++) if(ans2[i]!=0) cout << ans2[i] << endl;
  return 0;
}

C++: /*****include*****/
#include <iostream>
#include <fstream>
#include <string>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return 0;
	}
#endif
	/*****変数置き場*****/
	int num;
	int appear[101];
	int max;
	/*****処理部*****/
	max = 0;
	for(int i=0;i<101;i++)	appear[i] = 0;
	while(!cin.eof()){
		cin >> num;
		//cin >> num;
		appear[num] += 1;
	}
	for(int i=0;i<101;i++)
		if(appear[i] > max)	max = appear[i];
	for(int i=0;i<101;i++)
		if(appear[i] == max)
			cout << i << endl;
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define iREP(i,Itr) for(auto (i)=(Itr).begin();(i)!=(Itr).end();(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

int main(){
    
    int cnt[101]={};
    int t;
    while(cin>>t){
        cnt[t]++;
    }
    
    int maxa=-1;
    REP(i,101)maxa=max(maxa,cnt[i]);
    
    REP(i,101){
        if(cnt[i]==maxa)cout<<i<<endl;
    }
    
    return 0;
}

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

int main(void) {
    int n = 0, i, a[100], b[100] = {};
    while(cin >> i)
        a[n++] = i;
    for (int i= 0; i < n; ++i)
        ++b[a[i]];
    int max = 0;
    for (int i = 1; i <= 100; ++i)
        if (b[i] > max)
            max = b[i];

    for (int i = 1; i <= 100; ++i)
        if (max == b[i])
            cout << i << endl;

    return 0;
}