| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157882 | 陈襗葳 | 二进制数问题 | C++ | Compile Error | 0 MS | 0 KB | 679 | 2026-08-18 18:05:03 |
#includ <bits/stdc++.h> using namespace std; int main(){ int g,s,b,q,a=0,c=0; for(int i=0;i<=1000;i++){ string s=""; while(i=0){ s=s+char(i%2+'0'); i/=2; } reverse(s.begin(),s.end()) if(s%10==1){ a+1; } else{ c+1; } if((s/10)%10=1){ a+1; } else{ c+1; } if((s/100)%10=1){ a+1; } else{ c+1; } if(a>c){ cout<<A<<"类数"; } else{ cout<<B<<"类数"; } } }
Main.cc:1:2: error: invalid preprocessing directive #includ
#includ
^
Main.cc: In function 'int main()':
Main.cc:6:9: error: 'string' was not declared in this scope
string s="";
^
Main.cc:7:17: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
while(i=0){
^
Main.cc:11:19: error: request for member 'begin' in 's', which is of non-class type 'int'
reverse(s.begin(),s.end())
^
Main.cc:11:29: error: request for member 'end' in 's', which is of non-class type 'int'
reverse(s.begin(),s.end())
^
Main.cc:11:34: error: 'reverse' was not declared in this scope
reverse(s.begin(),s.end())
^
Main.cc:15:9: error: 'else' without a previous 'if'
else{
^
Main.cc:16:14: warning: statement has no effect [-Wunused-value]
c+1;
^
Main.cc:18:21: error: lvalue required as left operand of assignment
if((s/10)%10=1){
^
Main.cc:19:14: warning: statement has no effect [-Wunused-value]
a+1;
^
Main.cc:22:14: warning: statement has no effect [-Wunused-value]
c+1;
^
Main.cc:24:22: error: lvalue required as left operand of assignment
if((s/100)%10=1){
^
Main.cc:25:14: warning: statement has no effect [-Wunused-value]
a+1;
^
Main.cc:28:14: warning: statement has no effect [-Wunused-value]
c+1;
^
Main.cc:31:13: error: 'cout' was not declared in this scope
cout<