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>

int main(){
	int a,c=0,t=0;
	int b[101],f[101],z[101];
	z[0]=0;
	
	while(std::cin>>a){
         c++;
	    b[c]=a;
	}
	for(int g=1;g<=100;g++){
		f[g]=0;
		z[g]=0;
	}

	for(int d=1;d<=c;d++){
			f[b[d]]++;
			}
	
	for(int g=1;g<=100;g++){
		
			if(f[g]>z[0]){
			
			z[0]=g;
				t=0;
			}else if(f[g]==z[0]){
				t++;
			
				z[t]=g;
		}
	}
	
	for(int p=0;p<=t;p++){
		std::cout<<z[p]<<std::endl;
	}
	return 0;
		}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
 
 int arr[101]={0};
  
 int main()
 {
   int N;
   int max=0;
   while(cin>>N) arr[N]++;
   for(int i=1;i<=100;i++) if(arr[i]>max) max=arr[i];
   for(int i=1;i<=100;i++) if(arr[i]==max) cout<<i<<endl;             
   //while(1);     
   return 0;  
 }

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

struct value{
  int value_;
  int frequency;

  bool operator<(const value &value__) const {
    return frequency > value__.frequency;
  }

};

int main(){
  int tmp;
  vector<value> v(101);
  for(int i=0;i<101;++i){
    v[i].value_=i;
    v[i].frequency=0;
  }

  while(cin>>tmp){
    ++v[tmp].frequency;
  }

  sort(v.begin(),v.end());

  for(int i=0;i<101;++i){
    if(i>0){
      if(v[i].frequency!=v[i-1].frequency)
        break;
    }
    cout<<v[i].value_<<endl;
  }

  return EXIT_SUCCESS;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int a[100]={0};
	int b[100][2]={0};
	int B1,B2;
	int i=0;
	for(int h=0;h<100;h++)
	{
		b[h][1]=h+1;
	}
while (cin>>a[i])
{
	b[a[1]-1][0]++;
	i++;
}
for(int j=0;j<i;j++)
{
	for(int k=i-1;j<=j+1;j++)
	{
		if(b[i][0]>b[j][0])
		{
			B1=b[i][0];
			b[i][0]=b[j][0];
			b[j][0]=B1;
			B2=b[i][1];
			b[i][1]=b[j][1];
			b[j][1]=B2;
		}
	}
}
int l=0;
while(b[l][0]==b[0][0])
{
	cout<<b[l][1]<<endl;
}
}

C++: #define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 50//00
#define MIN -100001
#define _MAX 100
int main(void)
{
	int a[_MAX] = { 0 }, x, max = 0;
	while (scanf_s("%d", &x) != EOF) {
		++a[x - 1];
		if (a[x - 1] > max) max = a[x - 1];
	}
	for (int i = 0; i < _MAX; ++i) {
		if (a[i] == max) {
			printf("%d\n", i + 1);
		}
	}
}

C++: #include <iostream>

int main(void) {
    int a;
    int count[100] = {};
    int max = 0;
    while(std::cin >> a) {
        count[a - 1]++;
    }
    for (int i = 0; i < 100; i++) {
        if (count[i] > max) {
            max = count[i];
        }
    }

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

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
#ifdef _MSC_VER
const bool test = true;
#else 
const bool test = false;
#endif

int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
const int MAX = (int)2e5 + 5;

int main() {
	map<int, int> m;
	int v;
	while (cin >> v) {
		m[v]++;
	}
	vector<pair<int,int>> vec;
	for (auto p : m) {
		vec.push_back({ p.second, p.first });
	}
	sort(ALL(vec));
	rep(i,vec.size()) {
		if (vec[i].first == vec.back().first) {
			cout << vec[i].second << endl;
		}
	}
	return 0;
}

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<cstdio>
#include<map>
using namespace std;
int main(){
  int n;
  map<int,int> m;
  while(scanf("%d",&n)>0){
    int &i = m[n];
    if(i == 0) i=1;
    else i++;
  }
  int max=0;
  for(auto i:m)
    if(max < i.second)
      max=i.second;
  for(auto i:m)
    if(max==i.second)
      printf("%d\n",i.first);
}

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

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

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

using namespace std;

int main()
{
    vector <int> input(100, 0);
    int num;
    
    while (cin >> num) 
        input[num - 1]++;

    int max = 0;
    for (int i = 0; i < input.size(); i++) 
        if (input[i] > max)
            max = input[i];

    for (int i = 0; i < input.size(); i++)
        if (input[i] == max)
            cout << i + 1 << endl;

    return 0;
}

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

using namespace std;

int main() {

	int a, max1=0,b[101] = {};

	while (CI a) {
		b[a]++;
		max1 = max(b[a], max1);
	}

	for (int i = 0; i < 101; i++) {
		if (b[i] == max1)CO i EN;
	}

	return 0;
}

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

C++: #include <iostream>

using namespace std;

int main()
{
	int count[101] = {0};
	int a;
	
	while ( cin >> a ) count[a]++;
	
	int max_freq = 0;
	for (int i=1; i<=100; i++) {
		if (max_freq < count[i]) max_freq = count[i];
	}
	for (int i=1; i<=100; i++) {
		if (count[i] == max_freq) cout << i << endl;
	}
	
	return 0;
}

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

int main(){
  int i,a[N];
  while(cin >> i) a[i-1]++;
  int max = a[0];
  for(int j = 0; j < N; j++){
    if(max < a[j]) max = a[j];
  }
  for(int k = 0; k < N; k++){
    if(a[k] == max) cout << k + 1 << "\n";
  }
}

C++: #include<stdio.h>
int main(void)
{
	int i,a,cnt[101],max=-1;
	for(i=1;i<=100;i++){
		cnt[i]=0;
	}
	while(scanf("%d",&a)!=EOF){
		cnt[a]++;
	}
	for(i=1;i<=100;i++){
		if(max<cnt[i]){
			max=cnt[i];
		}
	}
	for(i=1;i<=100;i++){
		if(cnt[i]==max){
			printf("%d\n",i);
		}
	}
	return 0;
}

C++: #include <stdio.h>

int main(void)
{
	int a[101];
	int n;
	int i;

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

	while (scanf("%d", &n) != EOF){
		a[n]++;

		if (a[0] < a[n]){
			a[0] = a[n];
		}
	}

	for (i = 1; i <= 100; i++){
		if (a[i] == a[0]){
			printf("%d\n", i);
		}
	}

	return (0);
}