#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main() {
int n;
cin>>n;
int a[1000];
int x;
int max=-1;
int t=-1;
for(int i=0;i<1000;i++)
{
a[i]=0;
}
while(n--){
cin>>x;
a[x]++;
}
for(int j=0;j<1000;j++)
{
if(a[j]>max)
{
max=a[j];
t=j;
}
}
cout<<t<<endl;
return 0;
}
出现次数最多的数
最新推荐文章于 2021-07-17 16:54:37 发布