Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
125685 胡汪兵-小胡老师 19众数 C++ Accepted 7 MS 276 KB 297 2025-07-15 11:35:19

Tests(11/11):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int a[1001]={0},n,xb,max=0; cin>>n; for(int i=1;i<=n;i++) { cin>>xb; a[xb]++; } for(int i=1;i<=1000;i++) if(a[i]>max) { max=a[i]; xb=i; } cout<<xb; return 0; }