Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
131806 刘益梵 19选班长II C++ Accepted 1 MS 268 KB 409 2025-10-01 16:26:03

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int x[100]; int main(){ int a,top=0; while(true){ cin>>a; if(a==-1) break; if(a>0 && a<4) x[a]++; top++; } cout<<"A="<<x[1]<<endl; cout<<"B="<<x[2]<<endl; cout<<"C="<<x[3]<<endl; cout<<"Tot="<<top<<endl; if(x[1]>top/2) cout<<"A-yes"; else if(x[2]>top/2) cout<<"B-yes"; else if(x[3]>top/2) cout<<"C-yes"; else cout<<"all-NO"; }