| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 81095 | 赵文浚 | 19选班长II | C++ | Accepted | 1 MS | 272 KB | 548 | 2024-07-12 10:03:15 |
#include <iostream> using namespace std; int a[4]; int main() { int k,sum=0; for (int i=1;i<=1000;i++) { cin>>k; if(k==-1) { break; } else if(k>=1 && k<=3) { a[k]++; } sum++; } cout<<"A="<<a[1]<<endl; cout<<"B="<<a[2]<<endl; cout<<"C="<<a[3]<<endl; cout<<"Tot="<<sum<<endl; if(a[1]>sum/2) { cout<<"A-yes"<<endl; } else if(a[2]>sum/2) { cout<<"B-yes"<<endl; } else if(a[3]>sum/2) { cout<<"C-yes"<<endl; } else { cout<<"all-NO"<<endl; } }