#include<iostream>#include<map>#define INF 0x3f3f3f3fusingnamespace std;intmain(){
int n, v, ans = INF, count =0;
map<int,int> mp;
cin >> n;while(n--){
cin >> v;
mp[v]++;}//The map is automatically sorted in order of key valuefor(map<int,int>::iterator it = mp.begin();it != mp.end();++it){
if(it->second > count){
count = it->second;
ans = it->first;}}
cout << ans << endl;return0;}
6
20 1 20 10 30 10
10
2. ISBN号码
#include<stdio.h>intmain(){
char ch, s[13];int k =0, sum =0, ceof =1;while((ch=getchar())!='\n')
s[k++]=ch;for(int i =0;i <11;++i){
if(s[i]>='0'&& s[i]<='9')
sum +=(s[i]-'0')*(ceof++);}
sum %=11;
ch =(sum ==10)?'X': sum +'0';if(ch == s[12])printf("Right\n");else{
s[12]= ch;for(int i =0;i <13;++i)putchar(s[i]);putchar('\n');}return0;}
#include<iostream>#include<string>usingnamespace std;intmain(){
string s;int sum =0, mul =1;
cin >> s;for(int i =0; i <</