Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
132923 蒋雨翰 19选班长II C++ Accepted 1 MS 272 KB 444 2025-10-12 16:41:44

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int a[5]; int main(){ int n,Tot=0,q; while(1){ cin>>q; if(q==-1)break; if(q>=1&&q<=3)a[q]++; Tot++; } printf("A=%d\n",a[1]); printf("B=%d\n",a[2]); printf("C=%d\n",a[3]); printf("Tot=%d\n",Tot); if(a[1]>Tot/2){ cout<<"A-yes"; } else if(a[2]>Tot/2){ cout<<"B-yes"; } else if(a[3]>Tot/2){ cout<<"C-yes"; } else{ cout<<"all-NO"; } return 0; }