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

using namespace std;

typedef struct {
  int v;
  int i;
} data;

data map[100];

int greater(data a, data b){
  if(a.v > b.v) return 1;
  else if(a.v == b.v) return a.i < b.i;
  else return 0;
}

int main(){
  int i;
  for(i=0;i<100;i++) map[i].i=i+1,map[i].v = 0;

  int n;
  while(scanf("%d", &n)!=EOF) map[n-1].v++;

  sort(map, map+100, greater);

  int v = map[0].v;

  for(i=0;i<100;i++){
    if(map[i].v == v) printf("%d\n", map[i].i);
    else break;
  }
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cassert>

using namespace std;


bool solve(){
	vector<vector<int> > a(100, vector<int>(2, 0));
	for(int i=0;i<100;i++){
		a[i][0] = i;
	}
	int n;
	while(cin>>n){
		a[n][1]++;
	}
	for(int i=0;i<100-1;i++){
		for(int j=i;j<100;j++){
			if(a[i][1] < a[j][1]){
				swap(a[i][0],a[j][0]);
				swap(a[i][1],a[j][1]);
			}
		}
	}
	int hoge=0;
	while(1){
		cout<< a[hoge][0]<< endl;
		if(a[hoge][1]!=a[hoge+1][1]) break;
		hoge++;
	}
	
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

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

using namespace std;
int main(){
	int a[101]={0},n=0,saidai[100]={0},m=0;
	while(cin>>n){
		a[n]++;
	}
	for(int i=1;i<101;i++){
		if(saidai[m]<a[i]){
			for(int x=0;x<=m;x++){
				saidai[x]=0;
				m=0;
			}
			saidai[m]=i;
		}
		else if(saidai[m]==a[i]){
			saidai[m+1]=saidai[m];
			saidai[m]=i;
			m++;
		}
	}
	sort(saidai,saidai+100);
	for(int i=0;i<=100;i++){
		if(saidai[i]!=0){
			cout<<saidai[i]<<endl;
		}
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;

#define EPS 1e-8

int main(){
	
	map<int, int> mp;
	
	int a, maxi = 0;
	while(cin >> a){
		mp[a]++;
		maxi = max(maxi, mp[a]);
	}
	for(auto it : mp){
		if(maxi == it.second) cout << it.first << endl;
	}

	
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
#include<map>
#include<vector>
#define int long long
using namespace std;
int test[123];
signed main() {
	int n, a, ans = 0;
	for (int h = 0; h < 12; h++) {
		cin >> n;
		test[n]++;
	}
	for (int h = 1; h <= 100; h++) {
		ans = max(ans, test[h]);
	}
	for (int h = 1; h <= 100; h++) {
		if (test[h] == ans) {
			cout << h << endl;
		}
	}
}

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

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

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

using namespace std;

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

C++: 5
6
3
5
8
7
5
3
9
7
3
4

C++: // Mode Value

#include <iostream>
using namespace std;

int main() {
    int counter[100] = {};
    int val;
    int freq;
    // count
    while (cin >> val) {
        counter[val-1]++;
    }

    // find mode
    freq = 0;
    for (int idx = 0; idx < 100; idx++) {
        if (counter[idx] > freq)
            freq = counter[idx];
    }

    // print mode(s)
    for (int idx = 0; idx < 100; idx++) {
        if (counter[idx] == freq)
            cout << idx+1 << "\n";
    }
    return 0;
}

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

using namespace std;

int main(){
  int mode[101]={};
  for(int n;cin>>n;){
    mode[n]++;
  }
  int l=0;
  for(;;){
    int *mp=max_element(mode,mode+101);
    if(*mp<l)break;
    l=*mp;
    cout<<mp-mode<<endl;
    *mp=0;
  }
  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;
        }
    }
}

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

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(void){
    int n[100],cou[50],num=0,num2=0,moo[50],cou2=0;
    for(int i=0;i<100;i++){
        cin>>n[i];
    }
    for(int i=0;i<100;i++){
        if(0<n[i]&&n[i]<101){
        num++;
        }
    }
    for(int i=0;i<num-1;i++){
        cou[i]=0;
        for(int j=i+1;j<num;j++){
            if(n[i]==n[j]){
               cou[i]++;
               moo[i]=n[i];
            }
        }
    }
    for(int i=0;i<50;i++){
        if(0<cou[i]&&cou[i]<51){
           num2++;
        }
    }    
    for(int i=0;i<num2-1;i++){
        for(int j=0;j<num2-i-1;j++){
            if(cou[j]<cou[j+1]){
                swap(cou[j],cou[j+1]);
                swap(moo[j],moo[j+1]);
            }
        }
    }
    for(int i=0;i<num2;i++){
        if(moo[i]!=moo[i+1]){
            break;
        }
        cou2++;
    }
    for(int i=0;i<cou2-1;i++){
        for(int j=0;j<cou2-i-1;j++){
            if(moo[j]>moo[j+1]){
                swap(moo[j],moo[j+1]);
            }  
        }
    }
    for(int i=0;i<cou2;i++){
        cout<<moo[i]<<endl;
    }
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <math.h>
#include <functional>
#include <algorithm>
#include <utility>

typedef long long Int;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
using namespace std;

Int aa[120];

int main(){
	int a  = -1;
	while (cin >> a,a!=-1){
		++aa[a];
	}

	Int b = 0;

	REP(i, 120){
		b = max(b, aa[i]);
	}

	REP(i, 120){
		if (aa[i] == b)
			cout << i << endl;
	}

	return 0;
}