Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
88060 | 王馨桐 | 19选班长II | C++ | Wrong Answer | 1 MS | 268 KB | 507 | 2024-08-17 11:42:19 |
#include<bits/stdc++.h> using namespace std; int t[4]; int main(){ int p; int sum=0; for(int i=0; ; i++){ cin >>p; if(p==-1){ break; } if(p<=3 && p>=1){ t[p]++; } sum++; } cout <<"A=" <<t[1] <<endl; cout <<"b=" <<t[2] <<endl; cout <<"C=" <<t[3] <<endl; cout <<"Tot=" <<sum <<endl; int b; b=sum/2; if(t[1]>b){ cout <<"A-yes"; } else if(t[2]>b){ cout <<"B-yes"; }else if(t[3]>b){ 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