文章
61
粉丝
137
获赞
18
访问
39.9k
#include<bits/stdc++.h>
using namespace std;
int main (){
int n, tmp;
cin >> n;
set<int> myset;
int arr[n];
for(int i = 0; i < n; i++){
cin >> tmp;
myset.insert(tmp);
arr[i] = tmp;
}
for(auto it = myset.begin(); it != myset.end(); ++it){
if(count(arr, arr+n,*it) > n/2)
cout << *it;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发