Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
126904 | 饶晋吉 | 19选班长II | C++ | Accepted | 1 MS | 272 KB | 618 | 2025-07-22 14:14:41 |
#include<bits/stdc++.h> using namespace std; int main() { int A=0,B=0,C=0,D=0; for(int i=0;i<=10000;i++){ int a; cin>>a; if(a==1){ A++; } if(a==2){ B++; } if(a==3){ C++; } if(a==4){ D++; } if(a==-1){ break; } } int Tot=A+B+C+D; cout<<"A"<<"="<<A<<endl; cout<<"B"<<"="<<B<<endl; cout<<"C"<<"="<<C<<endl; cout<<"Tot"<<"="<<Tot<<endl; if(2*A>=Tot){ cout<<"A-yes"; }else if(2*B>=Tot){ cout<<"B-yes"; }else if(2*C>=Tot){ cout<<"C-yes"; }else{ cout<<"all-NO"; } return 0; }