异或相关的结果怎么表示呢
异或相关的结果怎么表示呢
异或相关的结果怎么表示呢
#include <iostream>
#include <string>
using namespace std;
int main()
{
while (true){
string strX, strY;
bool x = false, y = false;
cout << "x = ";
cin >> strX;
if (strX == "true") {
x = true;
}
cout << "y = ";
cin >> strY;
if (strY == "true") {
y = true;
}
cout << "x xor y = ";
if (x ^ y){
cout << "true";
}
else{
cout << "false";
}
cout << endl;
}
return 0;
}