- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- cin.sync_with_stdio(0);
- cout.sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- long long a,b,c,n=0;
- cin>>a>>b>>c;
- if((a!=0 && b!=0)==c){
- cout<<"AND\n";
- n++;
- }
- if((a!=0 || b!=0) ==c){
- cout<<"OR\n";
- n++;
- }
- if((a*b==0 && a+b!=0)==c){
- cout<<"XOR\n";
- n++;
- }
- if(n==0){
- cout<<"IMPOSSIBLE\n";
- }
- return 0;
- }
複製代碼 |