#O0013. 程序设计基本知识——逻辑运算

程序设计基本知识——逻辑运算

单选题

1、已知 A = 35H, A \land 05H \lor A \land 30H 的结果是()。 {{ select(1) }}

  • 30H
  • 05H
  • 35H
  • 53H

2、假设 A = true, B = false, C = true, D = true,逻辑运算表达式 A\landB\lorC\landD的值是()。 {{ select(2) }}

  • true
  • false
  • 0
  • 1
  • NULL

3、设全集 E={1,2,3,4,5},集合A={1,4}, B = {1,2,5}, C={2,4},
则集合(A\capB)\cup~C为()。 {{ select(3) }}

  • 空集
  • {1}
  • {3,5}
  • {1,5}
  • {1,3,5}

4、设全集 I = {a, b, c, d, e, f, g},集合A = {a, b, c}, B = {b, d, e}, C = {e, f, g},
那么集合(A-B)\cup(~C\capB)为()。 {{ select(4) }}

  • {a, b, c, d}
  • {a, b, d, e}
  • {b, d, e}
  • {b, c, d, e}
  • {d, f, g}

5、设A = true, B = false, C = false, D = true,以下逻辑运算表达式为真的是()。 {{ select(5) }}

  • (A \land B) \lor C \land D
  • ((A \land B) \lor C) \land D
  • A \land (B \lor C \land D)
  • (A \land B \lor C) \lor D
  • (A \land B) \land C \land D

6、设全集I = {a, b, c, d, e, f, g, h},集合B\cupA = {a, b, c, d, e, f}, C\capA = {c, d, e}, ~B\capA = {a, d},
那么集合 C\capB\capA 为()。 {{ select(6) }}

  • {c, e}
  • {d, e}
  • {e}
  • {c, d, e}
  • {d, f}

7、设A=B=D=true, C=false, 以下逻辑运算表达式值为真的有()。 {{ select(7) }}

  • (¬\lnot A \land B) \lor C \land D
  • ¬\lnot ((A \lor B \lor D) \land C)
  • ¬\lnot (A \land B \lor C \lor D)
  • (A \land B \land C) \lor ¬\lnot D

8、设A=B=true, C=D=false, 以下逻辑运算表达式值为假的有()。 {{ select(8) }}

  • (¬\lnot A \land B) \lor C \land D \lor A
  • ¬\lnot (((A \land B) \lor C) \land D)
  • A \land B \lor C \lor D \lor D
  • (A \land D \lor C) \land B

9、在C++中,表达式21^2的值是()。 {{ select(9) }}

  • 441
  • 42
  • 23
  • 24

10、在C++中,判断a不等于0且b不等于0的正确的条件表达式是()。 {{ select(10) }}

  • !a == 0 || !b == 0
  • !((a == 0) && (b) == 0)
  • !(a == 0 && b == 0)
  • a && b

11、在C++程序中,表达式 23|2^5 的值是()。 {{ select(11) }}

  • 23
  • 1
  • 32
  • 18

12、在C++程序中,判断a等于0或b等于0或c等于0的正确的条件表达式是()。 {{ select(12) }}

  • !((a != 0) || (b != 0) || (c) != 0)
  • !((a != 0) && (b != 0) && (c) != 0)
  • !(a == 0 && b == 0) || (c) != 0
  • (a = 0) && (b = 0) && (c) = 0