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

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int a,b,c,d; 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; } }


Run Info:

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