Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5295 郑元泰 19选班长 C++ Compile Error 0 MS 0 KB 325 2024-11-09 15:02:22

Tests(0/0):


Code:

# include<iostream> using namespace std; int main(){ int n,a[11]; cin>>n; for(int i=1;i<=n*3;i++){ cin>>m; a[m]++;//m号同学的票增加一票 } for(int i=1;i<=n;i++){ if(maxn<a[i]) maxn=a[i],no=i;//找票数最多的编号 } cout<<no<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:14: error: 'm' was not declared in this scope
         cin>>m;
              ^
Main.cc:11:12: error: 'maxn' was not declared in this scope
         if(maxn<a[i]) maxn=a[i],no=i;//找票数最多的编号
            ^
Main.cc:11:33: error: 'no' was not declared in this scope
         if(maxn<a[i]) maxn=a[i],no=i;//找票数最多的编号
                                 ^
Main.cc:13:11: error: 'no' was not declared in this scope
     cout<<no<<endl;
           ^