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>
#include <string>
#include <algorithm>
#include <math.h>

//#define PI 3.141592653589

using namespace std;



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

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

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

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
	int n;
	int a[101] = {};
	int max = 0;
	while (cin >> n) {
		a[n]++;
		if (max < a[n])max = a[n];
	}
	for (int i = 0; i < 102; i++)if(max==a[i])cout << i << endl;
	return 0;
}

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

C++: #include<iostream>
using namespace std;
int main(){
	int a[101]={},b,c=0;
	while(cin>>b){
		a[b]++;
	}
	for(int i=0;i<101;i++){
		if(c<a[i]){
			c=a[i];
		}
	}
	int i=0;
	for(;i<101;i++){
		if(a[i]==c){
			cout<<i+1<<endl;
		}
	}
	return 0;
}

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

int main(){
  int n[101]={0},a,max;
  queue<int> q;
  while(cin>>a)n[a]++;
  max=1;
  while(q.size())q.pop();
  for(int i=1;i<=100;i++){
    if(n[i]>max){
      while(q.size())q.pop();
      q.push(i);
      max=n[i];
    }else if(n[i]==max){
      q.push(i);
    }
  }
  while(q.size()){
    cout<<q.front()<<endl;
    q.pop();
  }
  return 0;
}

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

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

C++: #include<bits/stdc++.h>
using namespace std;
static const int MAX_N = 100;

int a[MAX_N];

int main(void){
	for(int i = 0; i <= MAX_N; i++){
		a[i] = 0;
	}

	int input;
	while(scanf("%d", &input) != EOF){
		a[input]++;
	}

	int max_a = 0;
	for(int i = 0; i < MAX_N; i++){
		if(a[i] > max_a) max_a = a[i];
	}
	for(int i = 0; i < MAX_N; i++){
		if(a[i] == max_a) printf("%d\n", i);
	}
	return 0;
}

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

int main()
{	
	int n, m = 0;
	int a[101];

	memset(a, 0, sizeof(a));

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

	for (int i = 1; i <= 100; i++)
		m = max(m, a[i]);

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

	return 0;
}

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

using namespace std;

void Solution()
{
    int n;
    
    int times = 0; // save the data in here about most frequently times
    
    int a[101] = {0};　// the array which saves the mode value, at the beginning is all "0"
    
    while(cin>>n)
    {
        a[n]++; //after input some value, array's value can be added by 1 (0 -> 1), repeat this part.
    }
    
    
    for(int i = 0; i < 101; i++) // the data is less than 100
    {
        if(a[i] > times) //check the  a[] value for ensuring the mode value
        {
            times = a[i]; //repeat this part, at the last, can find mode value
        }
    }
    
    for(int i = 0; i < 101; i++) //output mode value
    {
        if(a[i] == times)
        {
            cout<<i<<endl;
        }
    }
    return;
}

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

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
int main(){
  int out[101]={0};
  int in;
  while(cin>>in)out[in]++;
  int max1=0;
  rep(i,101)max1=max(max1,out[i]);
  rep(i,101)if(max1==out[i])cout<<i<<endl;
}

C++: #inlcude <stdio.h>
#include <stdlib.h>

int main(){
    int d[100];
    int maximize[100];

    int buf;
    while( scanf( "%d",&buf ) != EOF  ) d[buf-1]++;

    int buff = 0;
    for( int i = 0;i < 100;i++ ){
        if( d[i] > buff ) buff = d[i];
    }

    for( int i = 0;i < 100;i++ ){
        if( d[i] >= buff ) printf( "%d\n",i+1 );
    }
    return 0;
}

C++: #include <iostream>

int main(void)
{
	int count[100]={0},n;
	while(std::cin >> n)
		count[n-1]++;

	int max=0;
	for(int i=0; i<100; i++)
		if(count[i] > max)
			max = count[i];
	for(int i=0; i<100; i++)
		if(max == count[i])
			std::cout << i+1 << std::endl;
	return 0;
}

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

using namespace std;

int main() {

	int a, max1=0,b[101] = {};

	while (cin>> a) {
		b[a]++;
		max1 = max(b[a], max1);
	}

	for (int i = 0; i < 101; i++) {
		if (b[i] == max1)cout<< i <<endl;
	}

	return 0;
}

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

int main()
{
	vector<int> Vec(100);
	int n;
	while(cin>>n){
		Vec[n]++;
	}
	int max_r = 0, ans=0;
	for(int i=0;i<Vec.size();i++){
		max_r = max( max_r, Vec[i]);
	}
	for(int i=0;i<Vec.size();i++){
		if(max_r == Vec[i]){
			cout<<i<<endl;
		}
	}
	
	
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> pint;
#define foreach(i,n) for(i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

int main(){
	pair<int,int> a[101];
	rep(i,101){
		a[i].second=-i;
	}
	for(int k;cin>>k,k;){
		a[k].first++;
	}
	sort(a,a+101,greater<pair<int,int> >());
	for(int i=0;cout<<-a[i].second<<endl,a[i].F==a[i+1].F;i++);
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <vector>


using namespace std;
#define LENGTH 100

int main(){
  
  vector<int> Digit(LENGTH, 0);
  
  
  int tmp;
  int cnt=0;
  while(cin >> tmp){
    cnt++;
    Digit[tmp]++;
  }
  int max = 0;
  vector<int> maxDigits;
  for(int i=0;i<cnt;i++){
    if(Digit[i]>max){
      //      vector<int>().swap(maxDigits); //
      maxDigits.clear();
      maxDigits.push_back(i);
      max = Digit[i];
      //      cout << i << ">:" << endl; 
    }else{
      if(Digit[i]==max){
	maxDigits.push_back(i);
	//	cout << i << "==:" << endl;
      }
    }
  }

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

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

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int math[101],check,mmax=0;
    for(int i=1;i<101;i++)math[i]=0;
    while(scanf("%d",&check)!=EOF){
        math[check]++;
        if(math[check]>mmax)mmax=math[check];
    }
    for(int i=1;i<101;i++){
        if(check==math[i])cout<<i<<endl;
    }
}