Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5296 黄言岐 19选班长 C++ Compile Error 0 MS 0 KB 498 2024-11-09 15:02:31

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[11]n; int m; cin>>n; for(int i;i<=n*3;i++){ cin>>m; a[m]++; } int maxn=0; int no; for(int i=1;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:8:14: error: expected initializer before 'n'
     int a[11]n;
              ^
Main.cc:10:10: error: 'n' was not declared in this scope
     cin>>n;
          ^
Main.cc:13:9: error: 'a' was not declared in this scope
         a[m]++;
         ^
Main.cc:17:20: error: expected ';' before ')' token
     for(int i=1;i++){
                    ^
Main.cc:18:17: error: 'a' was not declared in this scope
         if(maxn<a[i])maxn=a[i],no=i;
                 ^