Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
70061 夏梓瑞 19选班长II C++ Compile Error 0 MS 0 KB 764 2024-04-13 15:28:12

Tests(0/0):


Code:

# include<iostream> # include<cstring> # include<cmath> using namespace std; int main() { int tot=0,d[10000]={0},x; while(1){ cin>>x; if(x==-1){ break; tot++; } if(x==1){ d[x]++; } if(x==2){ d[x]++; } if(x==3){ d[x]++; } } cout<<"A="<<d[1]<<endl<<"B="<<d[2]<<endl<<"C="<<d[3]<<endl<<"Tot"<<tot<<endl; if(d[1]==tot/2){ cout<<"A-yes"; } else if(d[2]>=tot/2){ cout<<"B-yes";} else if(d[2]>=tot/2){ cout<<"C-yes";} else cout<<"all-NO";


Run Info:

Main.cc: In function 'int main()':
Main.cc:37:27: error: expected '}' at end of input
             cout<<"all-NO";
                           ^