Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
8134 | 余立涵 | 11石头剪刀布 | C++ | Compile Error | 0 MS | 0 KB | 637 | 2025-06-14 19:39:24 |
#include<bits/stdc++.h> using namespace std; int main(){ int a,b;//石头 剪刀 布 cin>>a,b; if(a=1){ if(b=0){ cout<<"winner:2"<<endl; } if(b=2){ cout<<"winner:1"<<endl; } return 0 } if(a=0){ if(b=2){ cout<<"winner:2"<<endl; } if(b=1){ cout<<"winner:1"<<endl; } return 0 } if(a=2){ if(b=1){ cout<<"winner:2"<<endl; } if(b=0){ cout<<"winner:1"<<endl; } return 0 } return 0; }
Main.cc: In function 'int main()': Main.cc:5:13: warning: right operand of comma operator has no effect [-Wunused-value] cin>>a,b; ^ Main.cc:6:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(a=1){ ^ Main.cc:7:15: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(b=0){ ^ Main.cc:10:15: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(b=2){ ^ Main.cc:14:5: error: expected ';' before '}' token } ^ Main.cc:15:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(a=0){ ^ Main.cc:16:15: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(b=2){ ^ Main.cc:19:15: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(b=1){ ^ Main.cc:23:5: error: expected ';' before '}' token } ^ Main.cc:24:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(a=2){ ^ Main.cc:25:15: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(b=1){ ^ Main.cc:28:15: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(b=0){ ^ Main.cc:32:5: error: expected ';' before '}' token } ^