Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
105797 | 冯俊淞 | 19选班长II | C++ | Accepted | 1 MS | 276 KB | 523 | 2025-01-14 14:15:25 |
#include<bits/stdc++.h> using namespace std; int main() { int A=0,B=0,C=0,t=0; for(int i=1;i<10000;i++){ int a; cin>>a; if(a==-1){ break; } t++; if(a==1){ A++; }else if(a==2){ B++; }else if(a==3){ C++; } } cout<<"A"<<"="<<A<<endl; cout<<"B"<<"="<<B<<endl; cout<<"C"<<"="<<C<<endl; cout<<"Tot"<<"="<<t<<endl; if(A>t/2){ cout<<"A-yes"; }else if(B>t/2){ cout<<"B-yes"; }else if(C>t/2){ cout<<"C-yes"; }else{ cout<<"all-NO"; } return 0; }