Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
61259 彭慕允 19选班长II C++ Accepted 1 MS 272 KB 495 2023-12-03 12:04:25

Tests(10/10):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int n; int zp=0; int xz[3+1] = {0}; double b=0; while(1) { cin>>n; if(n==-1) { break; } zp++; if(n>=1&&n<=3) { xz[n]++; } } b=zp/2; cout<<"A="<<xz[1]<<endl; cout<<"B="<<xz[2]<<endl; cout<<"C="<<xz[3]<<endl; cout<<"Tot="<<zp<<endl; if(xz[1]>b) { cout<<"A-yes"; } else if(xz[2]>b) { cout<<"B-yes"; } else if(xz[3]>b) { cout<<"C-yes"; } else { cout<<"all-NO"; } }