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;
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", a[i]);
	}
	return 0;
}

C++: #include<stdio.h>

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

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

int main(){
	int a[100],b[100],buf,i;
	for(i = 0;i < 100;i++) a[i] = 0;
	while(scanf("%d",&buf) != EOF){
		a[buf - 1]++;
	}
	for(i = 0;i < 100;i++){
		b[i] = a[i];
	}
	sort(a,a + 100,greater<int>());
	for(i = 0;i < 100;i++){
		if(b[i] == a[0]) printf("%d\n",i + 1);
	}
	return 0;
}

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

int main(){
  int hist[100];
  for(int i=0; i<100;i++) hist[i] = 0;
 
  int n;
  while(cin >> n) hist[n]++;
  
  int maxv = 0;
  for(int i=0;i<100;i++){
    if(hist[i] >  maxv) maxv = hist[i];
  }
  
  for(int i=0;i<100;i++){
    if(maxv == hist[i]) cout << i << endl;
  }
  return 0;
}

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);
		}
	}
	return 0;
}

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

int main(){
	int t[101]={},tmp,k = 0,i;
	while(cin>>tmp){
		t[tmp+1]++;
		if(t[tmp]>k){
			k = t[tmp];
		}
	}
	for(i = 1;i <= 101;i++){
		if(t[i] == k){
			cout<<i-1<<endl;
		}
	}
	return 0;
}

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

using namespace std;

int main() {
  char *line = NULL;
  size_t buffer_size = 0;
  int frequencies[101] = {};
  int max_frequency = 0;
  while (getline(&line, &buffer_size, stdin) > 0) {
    int n;
    sscanf(line, "%d", &n);
    max_frequency = max(max_frequency, ++frequencies[n]);
  }
  free(line);

  for (int i = 1; i < 101; ++i) {
    if (frequencies[i] == max_frequency) {
      printf("%d\n", i);
    }
  }

  return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	
int d[103] = {0};
int n;
int m = 0;
while(cin >> n){
	d[n]++;
	if(d[n] > m) m = d[n];
}
for(int i = 1;i < 101;i++){
	if(d[i] == m) cout << i << endl;
}
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back


int main() {
    int n;
    int times[100]={};

    while(cin>>n){
        times[n]++;
    }
    int maxi=-1;
    rep(i,100+1){
        maxi=max(maxi,times[i]);
    }
    rep(i,100+1){
        if(times[i]==maxi){
            cout<<i<<endl;
        }
    }

    return 0;
}

C++: #include <stdio.h>
#include<math.h>
#include <string.h>
#include <ctype.h>

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

return 0;
}

C++: // Bowen Yu
// NYU - Progteam

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <complex>
#include <ctime>
#include <cassert>
#include <functional>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> PII;

#define REP(i,s,t) for(int i=(s);i<(t);i++)
#define FILL(x,v) memset(x,v,sizeof(x))

const int INF = (int)1E9;
#define MAXN 100005

char str[MAXN];
int main() {
  int x, max = 0;
  set<int> maxS;
  map<int,int> m;
  while (cin >> x) {
    if ( m.find(x) == m.end() ) {
      m[x] = 1;
    } else {
      m[x] = m[x] + 1;
    }

    if (m[x] > max) {
      max = m[x];
      maxS.clear();
      maxS.insert(x);
    } else if (m[x] >= max) {
      maxS.insert(x);
    }
  }

  for (set<int>::iterator it=maxS.begin(); it!=maxS.end(); ++it)
    cout << *it << endl;

  return 0;
}

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<10; i++) dic[i] = 0;
	while (cin >> data)
	{
		dic[data]++;
		max_data = max(max_data, dic[data]);
	}
	for (int i=0; i<10; i++)
	{
		if (dic[i] == max_data)
		{
			cout << i << endl;
		}
	}
	
	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++: #include<iostream>
#include<vector>
#include <iostream>

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 <bits/stdc++.h>

using namespace std;

int main()
{    
    int N, mx = 0; 
    map<int, int> mp;
    while (cin >> N) {
        mx = max(mx, ++mp[N]);
    }
    for (auto &v: mp) {
        if (v.second == mx) {
            cout << v.first << endl;
        }
    }        
    return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int counter[101];
	for(auto& i : counter)
		i = 0;

	{
		size_t input;
		while(cin >> input)
			counter[input]++;
	}

	int max = 0;
	for(auto& i : counter)
		if(max < i)
			max = i;

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

	return 0;
}

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

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

    while(cin >> n){
        hindo[n-1]++;
    }

    for(int i=0; i<100; i++){
        if(max < hindo[i]){
            max = hindo[i];
        }
    }

    for(int i=0; i<100; i++){
        if(max == hindo[i]){
            cout << i+1 << endl;
        }
    }
    return 0;
}