Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
163224 王顺煜 19选班长II C++ Accepted 1 MS 272 KB 494 2026-10-24 16:01:24

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int a[5]; int main() { int b; cin>>b; while(b!=-1) { if(b==1)a[1]++; else if(b==2)a[2]++; else if(b==3)a[3]++; else a[4]++; cin>>b; } int total=a[1]+a[2]+a[3]+a[4]; cout<<"A="<<a[1]<<"\nB="<<a[2]<<"\nC="<<a[3]<<"\nTot="<<total<<"\n"; if(a[1]>total/2) { cout<<"A-yes"; } else if(a[2]>total/2) { cout<<"B-yes"; } else if(a[3]>total/2) { cout<<"C-yes"; } else { cout<<"all-NO"; } return 0; }