Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

type Pair struct {
	key   int
	value int
}

func main() {
	scanner.Split(bufio.ScanWords)

	counts := map[int]int{}
	for {
		n, err := nextInt()
		if err != nil {
			break
		}

		counts[n]++
	}

	pairs := []Pair{}
	for k, v := range counts {
		pairs = append(pairs, Pair{k, v})
	}
	sort.Slice(pairs, func(i, j int) bool {
		if pairs[i].value == pairs[j].value {
			return pairs[i].key < pairs[j].key
		}
		return pairs[i].value > pairs[j].value
	})

	vMax := 0
	for _, pair := range pairs {
		if vMax != 0 && vMax != pair.value {
			break
		}
		if pair.value > vMax {
			vMax = pair.value
		}
		fmt.Println(pair.key)
	}
}

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

using namespace std;

void Solution()
{
    int n;
    
    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.
    }
    
    int times = 0; // save the data in here about most frequently times
    
    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++: 
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <utility>
#include <complex>
#include <stack>
#include <climits>

using namespace std;

double sq(double x){return x*x;}

int t[100];

int main(){
	int x;
	while(cin>>x){
		t[x-1]++;
	}
	int m = *max_element(t,t+100);
	for (int i = 0; i < 100; i++)
	{
		if(m == t[i]) cout << i+1 << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    vector<int> data(101);
    int n;
    while (cin >> n && n) {
        data[n] ++;
    }

    int maxn = *max_element(data.begin(), data.end());
    for (int i=0; i<101; ++i) {
        if (data[i] == maxn) {
            cout << i << endl;
        }
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
        const int MAX = 101;
        int num[MAX];
        for (int i = 1; i < MAX; i++) {
                num[i] = 0;
        }
        int a;
        while (cin >> a) {
                num[a]++;
        }
        int cnt = 0, max = 0;
        int mode[100];
        for (int i = 1; i < MAX; i++) {
                max = (max < num[i]) ? num[i] : max;
        }
        for (int i = 1; i < MAX; i++) {
                if (num[i] == max) {
                        mode[cnt++] = i;
                }
        }
        for (int i = 0; i < cnt; i++) {
                cout << mode[i] << endl;
        }

        return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <fstream>
#include <set>
#include <utility>

using namespace std;
int main() {
	vector<int> v(100,0);
	int n;
	while (cin >> n) {
		v[n - 1]++;
	}

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

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

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

int main(){
  vector<pair<int,int>> cnt(101);

  for(int i=1; i<=100; i++) cnt[i] = make_pair(0, i);

  int x;
  while(cin >> x) cnt[x].first++;

  sort(cnt.begin()+1, cnt.end());

  int maximum = cnt[100].first;
  for(int i=1; i<=100; i++){
    if(cnt[i].first == maximum){
      cout << cnt[i].second << endl;
    }
  }
}

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<iostream>
#include<algorithm>
using namespace std;
int main(){
int a[10000]={0};
int s,sai,ans=0,c=0;
while(cin>>s){
a[s]++;
c++;
}
for(i=0;i<c;i++){
if(a[i]>ans){
ans=a[i];
sai=i;
}
cout<<sai<<endl<<ans<<endl;
return 0;
}

C++: #include <iostream>
#include <map>
#include <queue>

using namespace std;

int main() {
  map<int, int> m;
  priority_queue<pair<int, int> > que;
  int n;
  while (cin >> n) {
    m[n]++;
  }
  for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) {
    que.push(pair<int, int>(it->second, it->first));
  }
  priority_queue<int, vector<int>, greater<int> > result;
  pair<int, int> maxi = que.top(); que.pop();
  result.push(maxi.second);
  while (!que.empty()) {
    pair<int, int> n = que.top(); que.pop();
    if (maxi.first == n.first) {
      result.push(n.second);
    } else {
      break;
    }
  }
  while (!result.empty()) {
    cout << result.top() << endl;
    result.pop();
  }

  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 < 101; i++)if(max==a[i])cout << i << endl;
	return 0;
}

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

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

int main()
{
	vector<int> N(101);
	int n,max=0;

	while (cin >> n){
		N[n]++;
	}

	for (int i = 0; i<N.size(); ++i){
		if (N[i] != 0)	{
			if (N[i] > max){
				max = N[i];
			}
		}
	}

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

	return 0;
}

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

#define MAXINUM   ( 100 + 1 )

using namespace std;

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int input[ MAXINUM ] = { 0 };
  int countMax = 0;

  do
  {
    int __tmp;
    
    cin >> __tmp;
    countMax = max ( countMax, ++input[ __tmp ] );
  }
  while ( !cin.eof ( ) );

  for ( int i = 0; i < MAXINUM; ++i )
  {
    if ( input[ i ] == countMax )
    {
      cout << i << endl;
    }
  }

  return ( 0 );
}