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>

using namespace std;

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

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define first first
#define second se
using namespace std;
typedef pair<int, int> P;
typedef vector<int> vi;


signed main(){
    int a;
    int d[110] = {0};
    while(cin >> a){
        d[a]++;
    }
    int MAX = 0;
    rep(i, 1, 101){
        MAX = max(MAX, d[i]);
    }
    vector<int> ans;
    rep(i, 1, 101){
        if(d[i] == MAX) ans. push_back(i);
    }
    rep(i, 0 ,ans.size()){
        cout << ans[i] << endl;
    }
}

C++: #include <stdio.h>

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

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

using namespace std;

int main()
{
	array< int, 101 > number = { 0 };
	int tmp, max_num = 0;

	while ( cin >> tmp )
	{
		number[tmp] = number[tmp] + 1;
		max_num = max( number[tmp], max_num );
	}

	tmp = 0;
	while ( tmp < 101 )
	{
		if ( max_num == number[tmp] )
		{
			cout << tmp << endl;
		}
		tmp = tmp + 1;
	}

	return 0;
}

C++: #include <algorithm>
#include <cctype>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <functional>
#include <queue>
#include <string>
#include <map>
#include <vector>

using namespace std;

int main() {
  map<int, int> fs;
  int x;
  while (scanf("%d", &x) == 1)
    fs[x]++;
  int c = 0;
  vector<int> rs;
  for (map<int, int>::iterator it = fs.begin(); it != fs.end(); ++it) {
    if (it->second == c)
      rs.push_back(it->first);
    if (it->second > c) {
      rs.clear();
      rs.push_back(it->first);
      c = it->second;
    }
  }
  for (int i = 0; i < rs.size(); i++)
    printf("%d\n", rs[i]);
  return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <stack>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
using namespace std;

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

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

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

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

int main(){
	int a, saizu;
	int num[100] = {0}, num2[100] = {0};
	vector<int> array;
	while(cin >> a){
		array.push_back(a);
	}
	saizu = array.size();
	for(int i = 0; i < saizu; i++){
		num2[array[i]-1]++;
		num[array[i]-1]++;
	}
	sort(num,num+saizu);
	for(int i = 0; i < 100; i++){
		if(num2[i] == num[saizu-1]){
			cout << i+1 << 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++)	data[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 <stdio.h>

struct freqency {
  
  int num;
  int freq;

}f[1000];

int main(void) {

  int n;

  int size=0;
  int max_freq=0;

  int mode[1000];
  int s=0;

  int i,j,temp;
  int flag;

  while(scanf("%d",&n)!=EOF) {
    //for(j=0;j<12;j++) {
    //scanf("%d",&n);
    flag=0;

    for(i=0;i<size;i++) {

      if(f[i].num==n) {
	flag=1;
	f[i].freq++;
      }

    }

    if(flag==0) {
	f[size].num=n;
	f[size].freq=1;
	size++;
    }

  }
  
  //for(j=0;j<10;j++) printf("%d %d\n",f[j].num,f[j].freq);

  for(i=0;i<size;i++) {

    if(max_freq<=f[i].freq) {
      max_freq=f[i].freq;
      mode[s]=f[i].num;
      s++;
    }

  }

  for(i=0;i<s;i++) {
    for(j=0;j<s-i-1;j++) {
      temp=mode[j];
      mode[j]=mode[j+1];
      mode[j+1]=temp;
    }
  }

  for(i=0;i<s;i++) {
    printf("%d\n",mode[i]);
  }

  

  return 0;

}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
int main() {
	vector<int> s,t;
	int a,i,j,k,l,len;
	int max = 0;
	for (i = 0; i <= 100; i++) {
		s.push_back(0);
	}
	while (cin >> a) {
		s[a] += 1;
	}
	for (j = 0; j <= 100; j++) {
		if (max < s[j]) {
			max = s[j];
		}
	}
	for (k = 0; k <= 100; k++) {
		if (s[k] == max) {
			t.push_back(k);
		}
	}
	len = t.size();
	for (l = 0; l < len; l++) {
		cout << t[l] << endl;
	}
	return 0;
}

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

#define ll (long long)
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

/*thief??????*/

int main(void){
    
    int input[120] = {0};
    int c  = 1;
    int check[100] = {0};
    int asnwer[100] = {0};
    int max = 0;
    while(cin >> input[c++])
    {
        int temp = input[c-1];
        check[temp]++;
    }
    REP(i, c)
        if(max <= check[i])
            max = check[i];
    
    REP(i,c) if(check[i] == max) cout << i << endl;
    return 0;
        }

C++: #include <iostream>

using namespace std;

int main() {
  int n, max;
  int t[100] = {0};

  while (cin >> n)
    t[n - 1] += 1;

  for (int i = max = 0; i < 100; i++)
    if (t[i] > 0)
      if (max < t[i]) max = t[i];

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

  return 0;
}