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

Tests(10/10):


Code:

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