###### tags: `Zerojudge` 【題解】c461: apcs 邏輯運算子 (Logic Operators) === Posted on 2022/4/22 | By : Victoria1103 【題目敘述】https://zerojudge.tw/ShowProblem?problemid=c461 ```cpp= #include <iostream> using namespace std; int main(){ int a , b , c , d = 1 ; cin >> a >> b >> c ; bool and1 = a&&b ; bool or1 = a||b ; bool xor1 = (a!=0)^(b!=0) ; if (and1 == c){ cout << "AND" << endl ; d = 0 ; } if (or1 == c){ cout << "OR" << endl ; d = 0 ; } if (xor1 == c){ cout << "XOR" << endl ; d = 0 ; } if (d){ cout << "IMPOSSIBLE" << endl ; } return 0 ; }
×
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