if 语句中的多个排他性条件
Multiple, exclusive, conditions in an if statement
if 语句中的前两个语句之一为假,但我希望前两个语句都为假,以便代码 NOT 运行。请帮忙。
void change(Shore* left, Shore* right, int ex, int can) {
if (((ex!=left->lastMove[0]) && (can!=left->lastMove[1])) && (left->hasBoat)) {
我也尝试了下面的代码,但也没有用
if ((ex!=left->lastMove[0] && can!=left->lastMove[1]) && left->hasBoat) {
void change(Shore* left, Shore* right, int ex, int can) {
if (((ex!=left->lastMove[0]) || (can!=left->lastMove[1])) && (left->hasBoat)) {
if 语句中的前两个语句之一为假,但我希望前两个语句都为假,以便代码 NOT 运行。请帮忙。
void change(Shore* left, Shore* right, int ex, int can) {
if (((ex!=left->lastMove[0]) && (can!=left->lastMove[1])) && (left->hasBoat)) {
我也尝试了下面的代码,但也没有用
if ((ex!=left->lastMove[0] && can!=left->lastMove[1]) && left->hasBoat) {
void change(Shore* left, Shore* right, int ex, int can) {
if (((ex!=left->lastMove[0]) || (can!=left->lastMove[1])) && (left->hasBoat)) {