设有下列语句序列:(x>;1)and(y<;=5)thenz←x*y;sez←x+y;z=12thenz←2*z。用判定条件覆盖法进行测试,则应选用()为测试用例。
A: x=1,y=12;x=4,y=7
B: x=2,y=1;x=3,y=3
C: x=3,y=4;x=1,y=9
D: x=4,y=5;x=1,y=6
A: x=1,y=12;x=4,y=7
B: x=2,y=1;x=3,y=3
C: x=3,y=4;x=1,y=9
D: x=4,y=5;x=1,y=6
举一反三
- 将正数12分成三个正数\(x\),\(y\),\(z\)之和,使得\(u=x^3y^2z\)为最大,则\(x\),\(y\),\(z\)分别为 A: \(x=6,y=1,z=5\) B: \(x=6,y=4,z=2\) C: \(x=6,y=3,z=3\) D: \(x=4,y=3,z=5\)
- 已知x=1,y=2,z=3,执行下列语句if(x>y) z=x;x=y;y=z;则x,y,z的值分别是 A: x=1,y=2,z=3 B: x=2,y=3,z=1 C: x=2,y=2,z=1 D: x=2,y=3,z=3
- 已知int x=1,y=2,z=3;以下语句执行后x,y,z的值是( ). if(x>y) z=x; x=y; y=z; A: x=1, y=2, z=3 B: x=2, y=3, z=3 C: x=2, y=3, z=1 D: x=2, y=3, z=2
- 执行以下语句的结果:dict1={"x":1,"y":2,"z":3}dict2={"x":4,"a":5}dict1.update(dict2) A: {"x":1,"y":2,"z":3,"x":4,"a":5} B: {"x":4,"a":5,"x":1,"y":2,"z":3} C: 有重复项,结果有误! D: {"x":4,"y":2,"z":3,"a":5}
- 已知int x=3,y=4;,写出下列表达式的值 (1) (x,y) (2) x>y?x:y (3) x?y:x (4) (x>y)?(y>=2)?1:2:(y>x)?x:y