Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
122058 龚睿晨 19选班长II C++ Compile Error 0 MS 0 KB 550 2025-06-14 10:20:15

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int a=0,b=0,c=0,t=0,p; for(int i=1;i<=10000;i++) { cin>>p; if(p==-1) { break; } if(p==1) { a++; } if(p==2) { b++; } if(p==3) { c++; } t++; } cout<<"A="<<a<<endl; cout<<"B="<<b<<endl; cout<<"C="<<c<<endl; cout<<"Tot="<<t<<endl; if(a*2>=t) { cout<<"A-yes"<<endl; } else if(b*2>=t) { cout<<"B-yes"<<endl;] } else if(c*2>=t) { cout<<"C-yes"<<endl; } else { cout<<"all-NO"; } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:37:23: error: expected primary-expression before ']' token
   cout<<"B-yes"<