| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 73255 | 孙睿阳 | 19选班长II | C++ | Wrong Answer | 1 MS | 268 KB | 613 | 2024-05-18 14:08:39 |
#include<bits/stdc++.h> using namespace std; int a[4]; int main(){ int k;//k是计那些是有效和无效 int n=0;//n是投票的人数 int b=0,c=0,d=0; while(1){ cin>>k; if(k==-1){ break; } n++; if(k>0&&k<4){ a[k]++; } if(k==1){ b++; } if(k==2){ c++; } if(k==3){ d++; } } cout<<"A="<<b<<endl; cout<<"B="<<c<<endl; cout<<"c="<<d<<endl; cout<<"Tot="<<n<<endl; if(b>(b+c+d)/2){ cout<<"A-yes"; } if(c>(b+c+d)/2){ cout<<"B-yes"; } if(d>(b+c+d)/2){ cout<<"C-yes"; } else{ cout<<"all-NO"; } return 0; }
------Input------
4 3 4 2 1 3 1 4 1 4 1 2 1 3 3 1 3 4 3 1 4 4 4 4 4 4 4 4 1 1 4 4 1 2 4 3 4 2 1 2 1 3 3 3 -1
------Answer-----
A=12 B=5 C=10 Tot=44 all-NO
------Your output-----
A=12 B=5 c=10 Tot=44 all-NO