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