#define Maxl = 10024int hash[Maxl];int main(int argc, char *argv[]){//freopen("aaa.txt", "r", stdin);int n;while(scanf("%d", &n) == 1){int m;for(m = 0; m < Maxl; m++)hash[m] = 0;while(n--){scanf("%d", &m);hash[m]++;}int max = 0, maxi = 0, i;for(i = 0; i < Maxl; i++){if(hash[i] > max){max = hash[i];maxi = i;}}printf("%d\n", maxi);}return 0; }
hdu1029
最新推荐文章于 2022-08-21 09:40:25 发布