我不明白为什么下面的语法不一样
if (j%3 != 0 && j%4 != 0)
if (!((j%3 == 0) && (j%4 == 0)))然而,下面的情况是。
if (j%3 != 0 && j%4 != 0) /
if (!((j%3 == 0) || (j%4 == 0)))为什么会这样?
!(A && B) != !A && !B和
!(A || B) == !A && !B / !(A && B) == !A || !B发布于 2022-03-25 05:33:39
这是数学布尔逻辑。
A and B <=> not (not A or not B)
not A and not B <=> not (A or B)
not (A and B) <=> not A or not B要证明这些方程,请使用值表。
0 & 0 = 0 !(1 | 1) = !1 = 0
0 & 1 = 0 !(1 | 0) = !1 = 0
1 & 0 = 0 !(0 | 1) = !1 = 0
1 & 1 = 1 !(0 | 0) = !0 = 1https://stackoverflow.com/questions/71612547
复制相似问题