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 <bits/stdc++.h>
using namespace std;
int main()
{
    int i,j,ara[1000],n=0,ara2[1000],k=0,c=1,max=0,mode,m;

    while (scanf ("%d",&m)!=EOF)
    {
        ara[n]=m;
        n++;
    }
    for (i=0;i<n-1;i++)
    {
        mode=0;
        for (j=i+1;j<n;j++)
        {
            if (ara[i]==ara[j])
            {
                mode++;
            }
        }
        if ((mode>max) && (mode!=0))
        {
            k=0;
            max=mode;
            ara2[k]=ara[i];
            k++;
        }
        else if (mode==max)
        {
            ara2[k]=ara[i];
            k++;
        }
    }
        sort(ara2,ara2+k);
        for (i=0;i<k;i++)
        {
            printf("%d\n",ara2[i]);
        }
        return 0;
}

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

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

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

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

using namespace std;

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

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
using namespace std;

int main(){
	int data[101]={},num,max=0;
	while(cin>>num){
		//if(num==0) break;
		data[num]++;
	}
	rep(i,1,101){
		if(data[i]>max) max=data[i];
	}
	rep(i,0,101){
		if(data[i]==max) cout<<i<<endl;
	}
}

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

C++: #include <stdio.h>
#include <math.h>
#include <iostream>

using namespace std;

int main() {

	int counter[101] = {0};
	int a;
	int MAX = 0;
	int i = 0;
	
	while (cin >> a) {
		counter[a]++;
	}

	for (int j = 1; j < 101; j++) {
		MAX = max(MAX, counter[j]);
	}

	for (int k = 1; k < 101; k++) {
		if (MAX == counter[k]) {
			cout << k << endl;
		}
	}

	return 0;
}

C++: #include<cstdio>
#define MAX(x,y) ((x>y)? x:y)

int date[100]={0};

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

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

using namespace std;

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

    return 0;
}

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

int compareq(const void*a, const void*b)
{
	return *(int*)a > *(int*)b ? 1 : *(int*)a == *(int*)b ? 0 : -1;
}

int main()
{
	int numbers[101], i = 0, maxnum[101];
	while (scanf("%d", &numbers[i]) != EOF)i++;
	qsort(numbers, i, sizeof(int), *compareq);
	int n, cnt = 0, max = 0, j = 0;
	for (n = 0; n < i; n++)
	{
		if (numbers[n] == numbers[n - 1])cnt++;
		else
		{
			if (cnt > max)
			{
				while (1)
				{
					maxnum[j++] = 0;
					if (j == 100)break;
				}
				maxnum[0] = n - 1;
				max = cnt;
				cnt = 0;
				j = 0;
			}
			else if (cnt == max)
			{
				maxnum[j++] = n - 1;
				cnt = 0;
			}
			else;
		}
	}
	j = 0;
	while (maxnum[j] != 0)
	{
		printf("%d\n", maxnum[j]);
	}
	return 0;
}

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

int main()
{
	int count = 0;
	int _in;
	int in[101] = {};
	
	while(scanf("%d",&_in)+1){
		++in[_in];	
	}
	
	_in = max(in[0],in[100]);
	for(int i=0;i<101;++i){
		if(in[i] == _in){
			cout << i << endl;
		}
	}
	
	return 0;
}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int c[101]={};
    int n, max=0;
    while(cin>>n){
        ++c[n];
        if(max<c[n]) max=c[n];
    }
    for(int i=1; i<=100; i++){
        if(c[i]==max) cout<<i<<'\n';
    }
    return 0;
}

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


int main(){

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

C++: #include<iostream>
using namespace std;
int main(){
	int times[101]={0};
	int num;
	while(cin >> num){
		times[num]++;
	}
	int maxtimes = 0;
	for(int i = 0;i < 101;i++){
		if(times[i] > maxtimes) maxtimes = times[i];
	}
	int maxnum[101]={0};
	int ptr=0;
	for(int i = 0; i < 101; i++){
		if(times[i]==maxtimes){
			maxnum[ptr++] = i;
		}
	}
	for(int i=0; i< ptr; i++){
		cout << maxnum[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<iostream>
#include<vector>
#include <algorithm>

using namespace std;

struct DATA{
  int number;
  int count;
};

void PushWordCount(int, vector<DATA>&);
bool Compare(const int&, const int&);

int main(){
  int i, n, max = 0;
  vector<int> Max;
  vector<DATA> data;

  while(cin >> n)
    PushWordCount(n, data);

  for(i=0; i<data.size(); ++i){
    if(data[i].count == max){
      Max.push_back(data[i].number);
    }else if(data[i].count > max){
      Max.clear();
      Max.push_back(data[i].number);
      max = data[i].count;
    }
  }
  sort(Max.begin(), Max.end());

  for(i=0; i<Max.size(); ++i)
    cout << Max[i] << endl;

  return 0;
}

void PushWordCount(int n, vector<DATA>& data){
  int isFound = 0;
  DATA newdata;
  vector<DATA>::iterator iter = data.begin();

  while(iter != data.end()){
    if(iter->number == n){
      isFound = 1;
      ++iter->count;
      break;
    }
    ++iter;
  }
  if(isFound == 0){
    newdata.number = n;
    newdata.count = 1;
    data.push_back(newdata);
  }
}

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

using namespace std;

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

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

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