| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 80027 | 李雨昊 | 19选班长II | C++ | Compile Error | 0 MS | 0 KB | 855 | 2024-07-11 10:36:43 |
#include<bits/stdc++.h> using namespace std; int main() { long s[10000]={},n,p=0,nums=-1,x=0; double a=0; while(1){ if(p == -1){ break; } cin>>p; nums+=1; s[p-1]+=1; } a = nums*1.0/2; // for(int i=0;i<x;i++) // cout<<s[i]<<endl; while(1){ if(s[x]>a){ if(x==0){ cout<<"A="<<s[x]<<endl<<"B="<<s[x+1]<<endl<<"C="<<s[x+2]<<endl<<"Tot="<<nums<<endl<<"A-yes"<<endl; break; } if(x==1){ cout<<"A="<<s[x]<<endl<<"B="<<s[x+1]<<endl<<"C="<<s[x+2]<<endl<<"Tot="<<nums<<endl<<"B-yes"<<endl; break; } if(x==2){ cout<<"A="<<s[x]<<endl<<"B="<<s[x+1]<<endl<<"C="<<s[x+2]<<endl<<"Tot="<<nums<<endl<<"C-yes"<<endl; break; } } else{ cout<<"A="<<s[x]<<endl<<"B="<<s[x+1]<<endl<<"C="<<s[x+2]<<endl<<"Tot="<<nums<<endl<<"all-NO"<<endl; break; } x++; }
Main.cc: In function 'int main()':
Main.cc:5:19: warning: unused variable 'n' [-Wunused-variable]
long s[10000]={},n,p=0,nums=-1,x=0;
^
Main.cc:41:1: error: expected '}' at end of input
}
^