Determine difference with logic operators

前端 未结 0 803
[愿得一人]
[愿得一人] 2021-01-21 15:00

I have this line of code

bool b1 = true;
bool b2 = true;
bool b3 = true;

bool areDifferent = b1 ^ b2 ^ b3;

which works, if there are only 2 bool

相关标签:
回答
  • 消灭零回复
提交回复
热议问题