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<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;
	}
}

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

using namespace std;

int main() {
	int num[101] = { 0 };
	int a;
	while (cin >> a) {
		num[a] += 1;
	}
	int max = -1;
	vector<int> vec;
	for (int i = 0; i <= 100; i++) {
		if (num[i] == max) {
			vec.push_back(i);
		}

		if (num[i] > max) {
			max = num[i];
			vec.clear();
			vec.push_back(i);
		}
	}
	for (int j = 0; j < vec.size(); j++) {
		cout << vec[j] << endl;
	}
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>

#define ll (long long)
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

/*thief??????*/

int main(void){
    
    int input[120] = {0};
    int c  = 1;
    int check[101] = {0};
    int asnwer[101] = {0};
    int max = 0;
    while(cin >> input[c])
    {
        int temp = input[c];
        check[temp]++;
        c++;
    }
    REP(i, 101)
        if(max <= check[i])
            max = check[i];
    
    REP(i,101) if(check[i] == max) cout << i << endl;
    return 0;
        }

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

using namespace std;

int main() {

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

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

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

	return 0;
}

C++: #include<iostream>
#include<map>
using namespace std;
int main(){
  map<int,int> num;
  int n,a=0;
  while(cin >>n) num[n]++;
  for(map<int,int>::iterator it = num.begin(); it!=num.end(); it++){
    if(a<(it->second)) a = it->second;
  }
  for(map<int,int>::iterator it = num.begin(); it!=num.end(); it++){
    if(a == (it->second)) cout<<(it->first)<<endl;
  }
  return 0;
}

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

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

using namespace std;

int main(){
	int num, max;
	int list[100] = {0};
	
	max = 0;

	while (cin >> num){
		list[num - 1]++;
		for (int i = 0; i < 100; i++){
			if (max < list[i]){
				max = list[i];
			}
		}
		for (int j = 0; j < 100; j++){
			if (list[j] == max){
				cout << j + 1 << endl;
			}
		}
	}
	return 0;
}