Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	table := make([]int, 100)
	now := 0
	max := 0
	for i := range table {
		table[i] = 0
	}
	for scanner.Scan() {
		now, _ =strconv.Atoi(scanner.Text())
		table[now-1]++
		if table[now-1] > max {
			max = table[now-1]
		}
	}
	for i := 0; i < 100; i++ {
		if table[i] == max {
			fmt.Println(i+1)
		}
	}
}

C++: #include<iostream>
 
using namespace std;
 
int main(){
    int n,max=0;
    int in[100]={0};
    while(cin>>n){
        in[n]++;
        if(max<in[n])max=in[n];
    }
    for(int i=0;i<100;i++){
     
        if(max==in[i])cout<<i<<endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

typedef complex<double> P;

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

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

int main(){
int a[100];
int b[100];
for(int i=0;i<100;i++){
b[i]=1;}
int ans[100];
int small[100];
int d=0;
int big=0;
int c=0;
//入力
while(cin>>a[c]){c++;}
//重複の削除
for(int i=0;i<c;i++){
for(int j=i+1;j<c;j++){
if(a[i]==a[j]){
b[i]++;
c--;
for(int k=j;k<c;k++){
a[k]=a[k+1];}
}}}
//最頻値の出る回数
for(int i=0;i<c;i++){
if(b[i]>big){big=b[i];}}
//最頻値リスト
for(int i=0;i<c;i++){
if(b[i]==big){
ans[d]=a[i];
d++;}}
//以上ok
//昇順に直す
small[0]=ans[0];
for(int i=1;i<d;i++){
for(int j=i-1;j>-1;j--){
if(small[j]<ans[i]){
for(int k=i;k>j+1;k--){
small[k]=small[k-1];}
small[j+1]=ans[i];
break;}}
if(ans[i]<small[0]){
for(int j=i;j>0;j--){
small[j]=small[j-1];}
small[0]=ans[i];}
}
//出力
for(int i=0;i<d;i++){
cout<<small[i]<<endl;}}

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


int main(){

	int n,max=0,x[100]={0};
	int x_max;
	
	while (scanf("%d",&n)) {
		if (n==0) {
			break;
		}
		x[n-1]++;
	}
	
	for (int i=0; i<100; i++) {
		if (max<x[i]) {
			max=x[i];
			x_max=i;
		}
	}
	cout << x_max+1 << endl;
	
	for (int i=x_max+1; i<100; i++) {
		if (x[x_max]==x[i]) {
			cout << i+1 <<endl;
		}
	}
		
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main(void)
{
  int max = 0, cnt[101];
  int n;

  for(int i = 0 ; i < 101 ; i++) {
    cnt[i] = 0;
  }

  while(scanf("%d",&n) != EOF) {
    cnt[n]++;
  }
  for(int i = 0 ; i < 101 ; i++) {
    if(max < cnt[i]) max = cnt[i];
  }
  for(int i = 0 ; i < 101 ; i++) {
    if(cnt[i] == max) cout << i << endl;
  }
  return 0;
}

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

int data[101];

void format(){
	int i;
	for(i=100;i--;){
		data[i]=0;
	}
}

int main(){
	format();
	int i;
	while((scanf("%d",&i))!=EOF){
		data[i]++;
		if(data[0]<data[i]){
			data[0]=data[i];
		}
	}
	
	for(i=100;i--;){
		if(data[100-i]==data[0]){
			printf("%d\n",100-i);
		}
	}
	
	
	
	return 0;
}

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

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

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

int d[101]={0};

int main(void){

	while (true){
		int n;
		cin>>n;
		if (cin.eof()) break;
		d[n]++;
	}
	int tmp=d[0];
	for (int i=0; i<101; i++) if (d[i]>tmp) tmp=d[i];
	for (int i=0; i<101; i++) if (d[i]==tmp) cout<<i<<endl;

	return 0;
}

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

class Mode_Value{
	int mode[100];
	int max;
public:
	Mode_Value();
	void setMode(int);
	void getMaxValue();
};

Mode_Value::Mode_Value(){
	max = 0;
	for(int i = 0; i < 100; i ++)
		mode[i] = 0;
}

void Mode_Value::setMode(int n){
	if(++mode[n - 1] > max)
		max = mode[n - 1];
}

void Mode_Value::getMaxValue(){
	for(int i = 0; i < 100; i ++){
		if(mode[i] == max)
			cout << i + 1 << endl;
	}
}

int main(){
	int a;
	Mode_Value m;
	while(scanf("%d",&a) != EOF)
		m.setMode(a);
	m.getMaxValue();
	return 0;
}

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

int main()
{
	int t,mc=0;
	map<int,int> m;
	while(cin >> t)
	{
		if(!(m.insert(pair<int,int>(t,1)).second))
		{
			m[t]++;
		}
		mc = (m[t]>mc ? m[t] : mc);
	}
	
	map<int,int>::iterator it;
	for(it=m.begin(); it!=m.end(); it++)
	{
		if(mc==it->second)
		{
			cout << it->first << endl;
		}
	}
}

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

using namespace std;

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

C++: #include <stdio.h>
#include <map>
using namespace std;
int main() {map<int,int>RB;int i,j;map<int,int>::iterator it;while(scanf("%d",&i)!=EOF) {if (RB.count(i)) RB[i]++; else RB[i]=1;}
for (j=0,it=RB.begin();it!=RB.end();it++) if (j<(it->second)) j=it->second;for (it=RB.begin();it!=RB.end();it++) if ((it->second)==j) printf("%d\n",it->first);return 0;}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main() {
	int num[100], max = 0, n;
	for (int w = 0; w < 100; w++) {
		num[w] = 0;
	}
	while (cin >> n) {
		if (n == 0)break;
		num[n - 1]++;
		if (num[n - 1] > max)max = num[n - 1];
	}
	for (int w = 0; w < 100; w++) {
		if (num[w] == max)cout << w + 1 << endl;
	}
	return 0;
}

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

using namespace std;

int main(void){
	
	int n,m=0;
	map<int,int> a;
	vector<int> ans;

	for(int i=0;i<=100;i++){
		a.insert(map<int,int>::value_type(i,0));
	}

	while(cin>>n){
		a[n]++;
	}
	
	for(int i=0;i<=100;i++){
		m=max(a[i],m);
	}
	
	for(int i=0;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<vector>
#include<algorithm>
using namespace std;
int main(){
	int n,num[110]={},x,ans1=0,ans2=0;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> x;
		num[x]++;
	}
	for(int i=1;i<=100;i++){
		if(num[i]>ans2){
			ans1 = i;
			ans2 = num[i];
		}
	}
	cout << ans1 << endl;
	return 0;
}

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

int main(){
  int x, maxx = 0;
  int cnt[102];
  vector<int> v;

  memset(cnt, 0, sizeof(cnt));

  while(cin >> x){
    cnt[x]++;
    if(maxx < cnt[x]){
      maxx = cnt[x];
      v.clear();
      v.push_back(x);
    }
    else if(maxx == cnt[x]){
      v.push_back(x);
    }
  }

  sort(v.begin(), v.end());

  for(int i = 0; i < v.size(); i++){
    cout << v[i] << endl;
  }
}

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(1){
		cin >> num;
		if(cin.eof())	break;
		//cin >> num;
		appear[num] += 1;
	}
	cout << endl;
	for(int i=0;i<101;i++)
		if(appear[i] > max){
			max = appear[i];
		}
	int ret = 0;
	for(int i=0;i<101;i++){
		if(appear[i] == max)
			cout << i;
		if(ret==0)	ret = 1;
		else		cout << endl;
	}
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

C++: #include<iostream>

using namespace std;

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