Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
77358 杨一诺 19选班长II C++ Compile Error 0 MS 0 KB 907 2024-06-09 08:12:17

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int a=0,b=0,c=0,d=0; long long n=1; int main(){ while(d!=-1){ cin>>d; if(d==1){ a++; } if(d==2){ b++; } if(d==3){ c++; } n+=1; } if((n-2)%2!=0){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<(n-2)<<endl; cout<<"all"<<'-'<<"NO"<<endl; } if(a>(n-2)/2){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<(n-2)<<endl; cout<<"A"<<'-'<<"yes"<<endl; } if(b>(n-2)/2){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<(n-2)<<endl; cout<<"B"<<'-'<<"yes"<<endl; } if(c>=n-2)/2){ cout<<'A'<<'='<<a<<endl; cout<<'B'<<'='<<b<<endl; cout<<"C"<<'='<<c<<endl; cout<<"Tot"<<'='<<(n-2)<<endl; cout<<"C"<<'-'<<"yes"<<endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:40:12: error: expected primary-expression before '/' token
  if(c>=n-2)/2){
            ^