###### tags: `APCS` `c++` # 題解 zerojudge c461: apcs 邏輯運算子 ```cpp= #include<iostream> using namespace std; int main(){ int a,b,c; bool match=false; cin>>a>>b>>c; if(a!=0) a=1; if(b!=0) b=1; if((a&&b)==c){ cout<<"AND\n";match=true; } if((a||b)==c){ cout<<"OR\n";match=true; } if((a^b)==c){ cout<<"XOR\n";match=true; } if(!match) cout<<"IMPOSSIBLE"; } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up