Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
5299 | 柯宇希 | 19选班长 | C++ | Compile Error | 0 MS | 0 KB | 283 | 2024-11-09 15:03:31 |
using namespace std; int n,a[11]; int m; int main(){ cin>>n; for(int i=1;i<=n*3;i++){ cin>>m; a[m]++; } int maxn=0 int m for(int i=1;i<=n;i++){ if(maxn<a[i]) maxn=a[i],no=i; } cout<<no<<endl; return 0; }
Main.cc: In function 'int main()': Main.cc:5:5: error: 'cin' was not declared in this scope cin>>n; ^ Main.cc:11:5: error: expected ',' or ';' before 'int' int m ^ Main.cc:12:17: error: 'i' was not declared in this scope for(int i=1;i<=n;i++){ ^ Main.cc:12:25: error: expected ';' before ')' token for(int i=1;i<=n;i++){ ^ Main.cc:15:5: error: 'cout' was not declared in this scope cout<<no<<endl; ^ Main.cc:15:11: error: 'no' was not declared in this scope cout<<no<<endl; ^ Main.cc:15:15: error: 'endl' was not declared in this scope cout<<no<<endl; ^ Main.cc:10:9: warning: unused variable 'maxn' [-Wunused-variable] int maxn=0 ^