Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
132920 刘轻松 19选班长II C++ Accepted 2 MS 276 KB 452 2025-10-12 16:40:12

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int a[5]; //投票箱 int main(){ int p,Tot=0; while(1){ cin>>p; if(p==-1) break; if(p>=1&&p<=3) a[p]++; 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"; } }