Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
107612 | 刘佳宇 | 19选班长II | C++ | Wrong Answer | 1 MS | 268 KB | 684 | 2025-01-18 10:45:24 |
#include<iostream> using namespace std; int p[4]; int main(){ int a,b,c,d=0,n; while(1){ cin>>n; if(n==-1){ break; } else{ d++; if(n>=1&&n<=3){ p[n]++; } } } cout<<"A"<<"="<<p[1]<<endl; cout<<"B"<<"="<<p[2]<<endl; cout<<"C"<<"="<<p[3]<<endl; cout<<"Tot"<<"="<<d; if(p[1]>d/2){ cout<<"A-yes"<<endl; } else if(p[2]>d/2){ cout<<"B-yes"<<endl; } else if(p[3]>d/2){ cout<<"C-yes"<<endl; } else{ cout<<"all-NO"<<endl; } }
------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=44all-NO