Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
143340 周宸宇 19选班长 C++ Compile Error 0 MS 0 KB 1590 2026-01-12 18:38:08

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[101]={0},max=0,max_i,n,x; cin>>n; for(int i=1;i<=n*3;i++){ cin>>x; a[x]++; } for(int i=1;i<=n;i++){ if(a[i]>max){ max=a[i]; max_i=i; } } cout<<max_i; return 0; }#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[101]={0},max=0,max_i,n,x; cin>>n; for(int i=1;i<=n*3;i++){ cin>>x; a[x]++; } for(int i=1;i<=n;i++){ if(a[i]>max){ max=a[i]; max_i=i; } } cout<<max_i; return 0; }#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[101]={0},max=0,max_i,n,x; cin>>n; for(int i=1;i<=n*3;i++){ cin>>x; a[x]++; } for(int i=1;i<=n;i++){ if(a[i]>max){ max=a[i]; max_i=i; } } cout<<max_i; return 0; }


Run Info:

Main.cc:23:2: error: stray '#' in program
 }#include  // cin\cout\endl
  ^
Main.cc:45:2: error: stray '#' in program
 }#include  // cin\cout\endl
  ^
Main.cc:23:3: error: 'include' does not name a type
 }#include  // cin\cout\endl
   ^
Main.cc: In function 'int main()':
Main.cc:29:5: error: redefinition of 'int main()'
 int main(){
     ^
Main.cc:7:5: note: 'int main()' previously defined here
 int main(){
     ^
Main.cc: At global scope:
Main.cc:45:3: error: 'include' does not name a type
 }#include  // cin\cout\endl
   ^
Main.cc: In function 'int main()':
Main.cc:51:5: error: redefinition of 'int main()'
 int main(){
     ^
Main.cc:7:5: note: 'int main()' previously defined here
 int main(){
     ^