Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
122061 蒋骏逸 19选班长II C++ Compile Error 0 MS 0 KB 495 2025-06-14 10:20:45

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n,A=0,B=0,C=0,ph,Tot=0; for(int i=1;i<=10000;i++) { cin>>m; if(m==1) A++; if(m==2) B++; if(m==3) C++; if(m==-1) break; } cout<<"A="<<A<<endl; cout<<"B="<<B<<endl; cout<<"C="<<C<<endl; cout<<"Tot="<<Tot<<endl; if(A*2>=Tot) cout<<"A-Yes"<<endl; else if(B*2>=Tot) cout<<"B-Yes"<<endl; else if(C*2>=Tot) cout<<"C-Yes"<<endl; else cout<<"all-No"<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:8: error: 'm' was not declared in this scope
   cin>>m;
        ^
Main.cc:5:6: warning: unused variable 'n' [-Wunused-variable]
  int n,A=0,B=0,C=0,ph,Tot=0;
      ^
Main.cc:5:20: warning: unused variable 'ph' [-Wunused-variable]
  int n,A=0,B=0,C=0,ph,Tot=0;
                    ^