Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
122289 周荣浩 19选班长II C++ Compile Error 0 MS 0 KB 721 2025-06-15 10:28:56

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ /** int n,m; cin>>n; int a[n+1]={0}; for(int i=1;i<=n;i++){ for(int j=1;j<=3;j++){ cin>>m; a[m]++; } } int max=a[1]; int j=1; for(int i=2;i<=n;i++){ if(max<a[i]){ max=a[i]; j=i; } } cout<<j;**/ int n=0,a[4]={0},s; while(ture){ cin>>s; if(s==-1){ break } a[s]++; n++; } cout<<"A="<<a[1]<<endl; cout<<"B="<<a[2]<<endl; cout<<"C="<<a[3]<<endl; cout<<"Tot"<<n<<endl; if(a[1]>n/2){ cout<<"A-yes"; }else if(a[2]>n/2){ cout<<"B-yes"; }else if(a[3]>n/2){ cout<<"C-yes"; }else{ cout<<"all-No"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:24:8: error: 'ture' was not declared in this scope
  while(ture){
        ^
Main.cc:28:3: error: expected ';' before '}' token
   }
   ^