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++: // 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif 

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int max_cnt = 0;
	map<int, int> m;
	int n;
	while(cin >> n){
		m[n]++;
		max_cnt = max(max_cnt, m[n]);
	}
	for(auto i:m){
		if(i.second == max_cnt)cout << i.first << '\n';
	}
	return 0;
}

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

C++: #include<bits/stdc++.h>
#define rep(i,n)for(ll i=0;i<n;i++)
using namespace std;
typedef long long ll;

int a[101];

int main() {
	int n;
	while (cin >> n)a[n]++;
	int Max = *max_element(a, a + 101);
	rep(i, 101) {
		if (a[i] == Max)cout << i << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

void count_num(int a,int b){
    string WDay[7] = {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
    int len[12] = {31,29,31,30,31,30,31,31,30,31,30,31};
    int count = 0;
    for(int i = 0; i< a-1;i++){
        count += len[i];
    }
    count += b;
    cout << WDay[(count+2) % 7] << endl;
}

int main() {
    int a,b;
    while(cin >> a >>  b , a){
        count_num(a,b);
    }
    return 0;
}

C++: 
#include <iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int a,i,max=0;
    vector<int> count(100,0);
    while(cin>>a){
        count[a]++;
    }
    for(i=1;i<count.size();i++){
        if(max<count[i])max=count[i];
    }
    for(i=1;i<count.size();i++){
        if(max==count[i])cout<<i<<endl;
    }
          return 0;
}

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

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

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

int main() {
	int a[100] = { 0 };
	int n;
	while (cin >> n,n)
		a[n - 1]++;

	int ma = 0;
	REP(i, 100){
		ma = max(ma, a[i]);
	}
	REP(i, 100){
		if (a[i] == ma)
			cout << (i + 1) << endl;
	}
	return 0;
}

C++: /* AOJ0028 Mode Value */  
  
#include <iostream>  
#include <algorithm>  
#include <map>  
#include <vector>  
  
using namespace std;  
  
typedef pair<int, int> PAIR;  
  
bool cmp(const PAIR& left, const PAIR& right)  
{  
    return left.second == right.second ? left.first < right.first : left.second > right.second;  
}  
  
int main()  
{  
    map<int, int> m;  
    int a, max;  
  
    while(~scanf("%d", &a))  
        m[a]++;  
  
    // map中元素转存到vector中  
    vector<PAIR> v(m.begin(), m.end());  
  
    // vector排序  
    sort(v.begin(), v.end(), cmp);  
  
    max = v[0].second;  
    for (int i = 0; i != (int)v.size(); ++i)  
        if(v[i].second == max)  
            cout << v[i].first << endl;  
        else  
            break;  
  
    return 0;  
}  

//这是老师的程序，目前我写的话还是会有难度的

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


int main() {
	int m[200];
	rep(i, 200) m[i] = 0;
	int mv = 0;
	for (int a; cin >> a; ) mv = max(mv, ++m[a]);
	REP(i, 1, 100) if (m[i] == mv) cout << i << endl;
	
	return 0;
}

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

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int n;
	std::vector<int> hist(101, 0);

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	while(ifs >> n){
#else
	while(std::cin >> n){
#endif
		hist[n]++;
	}

	int max_val = 0;
	for(int i = 1; i < hist.size(); i++){
		max_val = std::max(max_val, hist[i]);
	}
	
	for(int i = 1; i <hist.size(); i++){
		if(hist[i] == max_val){
			std::cout << i << std::endl;
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int i,m=0;
  int d[100]={};
  while(cin >> i) d[i-1]++;
  for(i=0;i<100;i++) m=max(m,d[i]);
  for(i=0;i<100;i++) if(d[i]==m) cout << (i+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
#define g 9.8
#define d 4.9
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);
		}
	}s
}