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

Python: x=[]
while True:
    try:
        n=int(input())
        x.append(n)
    except:
        break
c=[0]*101
for i in x:
    c[i]+=1
b=max(c)
for j in range(100):
    if c[j]==b:
        print(j)

Python: x=[0]*100
while True:
    try:
        y=int(input())
        x[y-1]+=1
    except:
        break
z=max(x)
for i in range(100):
   if x[i] == z:
      print(i+1)

Python: import sys
  
freq = {}

for s in sys.stdin:
    n = int(s.strip())
    if n not in freq:
        freq[n] = 1
    else:
        freq[n] += 1

sortedfreq = sorted(freq.items(), key=lambda x:-x[1])
modes = sorted(filter(lambda x: x[1] == sortedfreq[0][1], sortedfreq), key=lambda x:x[0])
for i in modes:
    print(i[0])

Python: a = {}
while True:
    try:
        a_i = int(input())
        if a_i in a:
            a[a_i] += 1
        else:
            a[a_i] = 1
    except:
        break
mode_count = max(a.values())
b = []
for key, value in a.items():
    if value == mode_count:
        b.append(key)
print(*sorted(b),sep="\n")

Python: import sys
d = {}
for l in sys.stdin.readlines():
    d[int(l)] = d.get(int(l), 0) + 1
l = sorted(d, key=d.get)
n = d[l[-1]]
for x in l:
    if d[x] == n:
        print(x)

Python: a=0
b=[]
while True: 
    try:
        n=int(input())
        b.append(n)
    except:
        break
c=[0]*101
for i in b:
    c[i]+=1
d = max(c)  
for k in range(100):
    if c[k]==d:
        print(k)

Python: list=[]
while True:
    try:
        x=int(input())
    except:
        break
    list.append(x)

tmp=1
ans=[]
for i in range(100):
    num=0
    for l in range(len(list)):
        if i==list[l]:
            num+=1
    if num>tmp:
        tmp=num
        ans=[i]
    elif num==tmp:
        ans.append(i)
for n in range(len(ans)):
    print(ans[n])

Python: import sys
S = sys.stdin.readlines()
cnt = [0] * 101
for s in S:
    n = int(s)
    cnt[n] += 1
m = max(cnt)
n = cnt.count(m)
p = 0
for i in range(n):
    p = cnt.index(m)
    print(p)
    cnt[p] = 0

Python: import collections
import sys
cntr = collections.Counter
for line in sys.stdin:
    cntr[int(line)] += 1
lst = []
for k,v in cntr.items():
    lst.append((v,k))
lst.sort()
t = len(lst)-1
while t>0 and lst[t][0] == lst[t-1][0]:
    t -= 1
for i in range(t,len(lst)):
    print(lst[i][1])

Python: a = [0] * 100

while True :
    try :
        a[int(input())] += 1
    except :
        break
    
x = max(a)


for i in range(100) :
    if a[i] == x :
        print(i)

Python: a = list([0] * 100)

while True :
    try :
        a[int(input())-1] += 1
    except EOFError :
        break
    
x = max(a)
for i in range(100) :
    if a[i] == x :
        print(i+1)

Python: a = [0]*101

while True:
    try:
        a[int(input())] += 1

    except EOFError:
        break

k = max(a)
for i in range(100):
    if a[i] == k:
        print(i)

Python: import sys

count = [0 for _ in range(101)]
mode = 0

for s in sys.stdin:
    x = int(s)
    count[x] += 1
    mode = max(mode, count[x])

for i in range(101):
    if count[i] == mode:
        print(i)

Python: a=[]

try :
    while True:
        a.append(int(input()))
except EOFError :
    pass
counts = [0]*101

for n in a:
    counts[n] += 1
for n in range(len(a)):
    if counts[n] == max(counts):
        print(n)

Python: import sys
readlines = sys.stdin.readlines
write = sys.stdout.write
def solve():
    mp = {}
    for line in readlines():
        v = int(line)
        mp[v] = mp.get(v, 0) + 1
    ma = max(mp.values())
    ans = [k for k, v in mp.items() if v == ma]
    ans.sort()
    write("\n".join(map(str, ans)))
    write("\n")
solve()

C++: #include <stdio.h>

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

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

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

typedef complex<double> P;

int main(){
	int n;
	map<int,int> p;
	int mx = 0;
	while( cin >> n){
		mx = max(mx,++p[n]);
	}
	for(auto i : p )
		if( mx == i.second ) cout << i.first << endl;
	
			
			
}

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

int main(){
int a[100];
int b[100];
for(int i=0;i<100;i++){
b[i]=1;}
int ans[100];
int small[100];
int d=0;
int big=0;
int c=0;
//入力
while(cin>>a[c]){c++;}
//重複の削除
for(int i=0;i<c;i++){
for(int j=i+1;j<c;j++){
if(a[i]==a[j]){
b[i]++;
c--;
for(int k=j;k<c;k++){
a[k]=a[k+1];}
}}}
//最頻値の出る回数
for(int i=0;i<c;i++){
if(b[i]>big){big=b[i];}}
//最頻値リスト
for(int i=0;i<c;i++){
if(b[i]==big){
ans[d]=a[i];
d++;}}
//以上ok
//昇順に直す
small[0]=ans[0];
for(int i=1;i<d;i++){
for(int j=i-1;j>-1;j--){
if(small[j]<ans[i]){
for(int k=i;k>j+1;k--){
small[k]=small[k-1];}
small[j+1]=ans[i];
break;}}
if(ans[i]<small[0]){
for(int j=i;j>0;j--){
small[j]=small[j-1];}
small[0]=ans[i];}
}
//出力
for(int i=0;i<d;i++){
cout<<small[i]<<endl;}}

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


int main(){

	int n,max=0,x[100]={0};
	int x_max;
	
	while (scanf("%d",&n)) {
		if (n==0) {
			break;
		}
		x[n-1]++;
	}
	
	for (int i=0; i<100; i++) {
		if (max<x[i]) {
			max=x[i];
			x_max=i;
		}
	}
	cout << x_max+1 << endl;
	
	for (int i=x_max+1; i<100; i++) {
		if (x[x_max]==x[i]) {
			cout << i+1 <<endl;
		}
	}
		
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main(void)
{
  int max = 0, cnt[101];
  int n;

  for(int i = 0 ; i < 101 ; i++) {
    cnt[i] = 0;
  }

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

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

int data[101];

void format(){
	int i;
	for(i=100;i--;){
		data[i]=0;
	}
}

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

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

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

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

int d[101]={0};

int main(void){

	while (true){
		int n;
		cin>>n;
		if (cin.eof()) break;
		d[n]++;
	}
	int tmp=d[0];
	for (int i=0; i<101; i++) if (d[i]>tmp) tmp=d[i];
	for (int i=0; i<101; i++) if (d[i]==tmp) cout<<i<<endl;

	return 0;
}