Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
88057 陈昊然 19选班长II C++ Accepted 1 MS 272 KB 500 2024-08-17 11:25:10

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int n,a,b,c,t[4],bz=1,yg; int main() { while(cin>>n) { if(n==-1) { break; } yg+=1; t[n]++; } for(int i=0; i<=3; i++) { if(t[i]>t[bz]) { bz=i; } } cout<<"A="<<t[1]<<endl; cout<<"B="<<t[2]<<endl; cout<<"C="<<t[3]<<endl; cout<<"Tot="<<yg<<endl; if(t[1]>yg/2) { cout<<"A-yes"; }else if(t[2]>yg/2) { cout<<"B-yes"; }else if(t[3]>yg/2) { cout<<"C-yes"; }else{ cout<<"all-NO"; } return 0; }