Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
105785 | 张永良 | 19选班长II | C++ | Compile Error | 0 MS | 0 KB | 784 | 2025-01-14 14:10:08 |
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:4:1: error: expected unqualified-id before 'while' while(1){ ^