返回列表 發帖
  1. #include<bits/stdc++.h>
  2. using namespace std;

  3. int main()
  4. {
  5.     int a, b, c, d=0;
  6.     cin>>a>>b>>c;
  7.     if((a and b)==c)
  8.     {
  9.         d++;
  10.         cout<<"AND"<<endl;
  11.     }
  12.     if((a || b) ==c)
  13.     {
  14.         cout<<"OR"<<endl;
  15.         if((a && b)==0)
  16.             cout<<"XOR";
  17.             d++;
  18.     }
  19.     if((a*b!=0 && c==0))
  20.     {
  21.         cout<<"XOR";
  22.         d++;
  23.     }
  24.     if(d==0)
  25.         cout<<"IMPOSSIBLE";
  26.     return 0;
  27. }
複製代碼

TOP

返回列表