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 <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapii map<int, int>
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()
#define minit(a, i) memset(a, i, sizeof(a));

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

typedef long long ll;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }


int main() {
	int a[110]; minit(a, 0);
	int in, maxl = 0;
	while (cin>>in) { a[in]++; maxl = max(maxl, a[in]); }
	for_(i, 0, 110) if (a[i]==maxl) cout << i << endl;
	return 0;
}

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]){
            if(cou==0){
                cout<<i;
                cou++;
            }else cout<<" "<<i;
        }
    }
    cout<<endl;
return 0;
}

C++: #include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
    int n;
    map<int, int> numbers;
    while (cin >> n) {
        numbers[n]++;
    }
    int maxMode = 0;
    vector<int> maxNumber;
    for (map<int,int>::iterator it=numbers.begin(); it != numbers.end(); ++it) {
        if (it->second > maxMode) {
            maxMode = it->second;
            maxNumber.clear();
            maxNumber.push_back(it->first);
        }
        else if (it->second == maxMode) {
            maxMode = it->second;
            maxNumber.push_back(it->first);
        }
    }
    for (int i = 0; i != maxNumber.size(); ++i) {
        cout << maxNumber[i] << endl;
    }
    return 0;
}

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

int main(){

  int num[100],n;
  int a=0;

  for(int i=0;i<100;i++)
    num[i] = 0;

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

  for(int i=0;i<100;i++)
    a = max(a,num[i]);

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

  return 0;
}

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

typedef pair<int , int > P;
P data[101];
int in;

int main(void)
{

	for(int i = 0; i <= 100; i++)
		data[i].second = i;
	while(cin >> in, !cin.eof()){
		data[in].first++;
	}

	sort(data,data+101);
	int def = data[100].first;
	for(int i = 0; i <= 100; i++)
		if(data[i].first == def)
		cout << data[i].second << endl;

	return 0;
}

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

typedef pair<int, int> P;
typedef stack<int> S;

bool pairCompare(const P& firstElem, const P& secomdElem)
{
	return firstElem.second < secomdElem.second;
}

int main(void)
{
	vector<P> v;
	for (int i = 0; i < 100; i++) v.push_back(P(i, 0));
	int num;
	while (cin >> num && num) v[num].second++;
	stable_sort(v.begin(), v.end(), pairCompare);
	int i = v.size() - 1;
	S s;
	while (v[v.size() - 1].second == v[i].second) {s.push(v[i].first); i--;}
	while (s.size()) {cout << s.top() << endl; s.pop();}
	
	return 0;
}

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000
#define MAXN 110
typedef long long ll;
 
int a[MAXN];
 
int main(void) {
    int n;
    while (cin >> n) a[n]++;
    int ma = 0;
    for (int i = 0; i <= 100; i++) ma = max(ma, a[i]);
    vector<int> ans;
    for (int i = 0; i <= 100; i++) {
        if (a[i] == ma) ans.push_back(i);
    }
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << endl;
    }
    return 0;
}

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

using namespace std;

struct cell{
	int no;
	int n;
};

bool compare(const cell& left, const cell& right)
{
  return left.n > right.n ;
}

#define MAX 100

int main()
{
	vector<cell> data(MAX);
	int a;
	int i;

	for (i = 0; i < MAX; i++) {
		data[i].no = i+1;
		data[i].n = 0;
	}

	while (cin>>a) {
		data[a-1].n ++;
	}

	sort(data.begin(), data.end(), compare);

	cout<<data[0].no<<endl;
	for (i = 1; i < MAX; i++) {
		if (data[i-1].n != data[i].n) break;
		cout<<data[i].no<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
  vector<int> cnt(100, 0);
  vector<int>::iterator itr = cnt.begin();
  int buf;

  while(cin >> buf) {
	cnt[buf - 1]++;
  }
  for(;;) {
	itr = find(itr, cnt.end(), *max_element(cnt.begin(), cnt.end()));
	if(itr == cnt.end()) break;
	cout << itr - cnt.begin() + 1<< endl;
	++itr;
  }
  return 0;
}

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

int main(){
	int a[110], i=1, b[110];
	vector<int> ans;
	for(int i=0 ; i<110 ; i++){
		b[i] = 0;
	}

	while(cin >> a[i]){
		if(i==100 || a[i]==-1)break;

		b[ a[i] ]++;
	}
	int num = 0;
	for(int i=1 ; i<=100 ; i++){
		if( num < b[i] ){
			ans.clear();
			num = b[i];
			ans.push_back(i);
		}
		else if( num == b[i] ){
			ans.push_back(i);
		}
	}

	sort( ans.begin() , ans.end() );
	for(int i=0 ; i<ans.size() ; i++){
		cout << ans[i] << endl;
	}
	return 0;
}

C++: #include <stdio.h>
int main(){
char ch;
int num,max;
int p[10]={0};
int q[2][10]={0};
while(scanf("%d",&num) != EOF)    
{         
	p[num] += 1;     
}   

max=0;
for(int i=0;i<10;i++){
if(max<p[i])max=p[i];
}
for(int i=0;i<10;i++){
if(max==p[i])printf("%d\n",i);
}

return 0;
}

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

int main(){

int numbers[100] , x ,y;
y = max(numbers[x]);

while ( cin >> x ){
numbers[x - 1]++;
}

while ( y != 1 ){
cout << numbers[x] << endl;
}

return 0;
}