文章
17
粉丝
133
获赞
4
访问
93.2k
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
map<int,int> mp;
for(int i = 0; i < n; i++){
int temp;
cin >> temp;
mp[temp]+=1;
}
int count = 0;
int result;
map<int,int>::iterator iter;
for(iter = mp.begin();iter!=mp.end();iter++){
if(iter->second > count) {
count = iter->second;
result = iter->first;
}
}
cout << result;
}
登录后发布评论
暂无评论,来抢沙发