Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
146241 罗晟睿 19选班长II C++ Compile Error 0 MS 0 KB 481 2026-01-27 14:17:08

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int a[100]; int main() { int a,p1=0,p2=0,p3=0,tot=0; while(1) { cin>>a; if(a==-1)break; else if(a==1) p1++; else if(a==2) p2++; else if(a==3) p3++; tot++; } printf("A=%d\n",p1); printf("B=%d\n",p2); printf("C=%d\n",p3); printf("D=%d\n",tot); if(p1>tot/2) { cout<<"A-yes" } if(p2>tot/2) { cout<<"B-yes" } if(p3>tot/2) { cout<<"C-yes" } else { cout<<"all-No" } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:20:2: error: expected ';' before '}' token
  }
  ^
Main.cc:23:2: error: expected ';' before '}' token
  }
  ^
Main.cc:26:2: error: expected ';' before '}' token
  } else {
  ^
Main.cc:28:2: error: expected ';' before '}' token
  }
  ^