| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 61334 | 夏轩淇 | 19选班长II | C++ | Compile Error | 0 MS | 0 KB | 690 | 2023-12-03 17:34:33 |
#include<iostream> using namespace std; int main() { int xz[4]={0}; int p,tot=0,sps; int sum=0; while(1){ cin>>p; if(p==-1){ break; } sum++; if(p>0&&p<4){ xz[p]++; }else{ tot++; } } cout<<"A="<<xz[1]<<endl; cout<<"B="<<xz[2]<<endl; cout<<"C="<<xz[3]<<endl; cout<<"Tot="<<sum<<endl; for(int i=1;i<=3;i++){ if(xz[i]>(double)sum/2){ if(i==1){ sps=1; }else if(i==2){ sps=2; }else{ sps=3 } }else{ sps=4 } } if(sps==1){ cout<<"A-yes"; }else if(sps==2){ cout<<"B-yes"; }else if(sps==3){ cout<<"C-yes"; }else{ cout<<"all-NO"; } return 0; }
Main.cc: In function 'int main()':
Main.cc:33:4: error: expected ';' before '}' token
}
^
Main.cc:36:3: error: expected ';' before '}' token
}
^