#include <iostream>
#include <cmath>
using namespace std;
int main()
{
bool p, q;
p = true;
q = true;
cout << p << " XOR " << q << " is " <<
( (p || q) && !(p && q) ) << "\n";
p = false;
q = true;
cout << p << " XOR " << q << " is " <<
( (p || q) && !(p && q) ) << "\n";
p = true;
q = false;
cout << p << " XOR " << q << " is " <<
( (p || q) && !(p && q) ) << "\n";
p = false;
q = false;
cout << p << " XOR " << q << " is " <<
( (p || q) && !(p && q) ) << "\n";
return 0;
}
1 XOR 1 is 0
0 XOR 1 is 1
1 XOR 0 is 1
0 XOR 0 is 0