#include <iostream>
#include<math.h>
using namespace std;
int main()
{
int n;
cin >> n;
int num[n];
for (int i = 0;i < n;i++)
{
cin >> num[i];
}
int count = 0;
int res[10000];
for (int i = 0;i < 10000;i++)
res[i] = 0;
for (int i = 0;i < n;i++)
{
res[num[i]]++;
}
int max = res[0];
int result = 0;
for (int i = 9999;i>=0;i--)
{
if (res[i] >= max)
{
max = res[i];
result = i;
}
}
cout << result;
}
20131201---出现次数最多的数
最新推荐文章于 2024-05-02 21:47:48 发布