网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
5、阅读下面程序,选择正确输出结果_______________。x = 10 y = 20 if x > 10: if y > 20: z = x + y print('z is', z) else: print(x)
A.10
B.20
C.30
D.没有输出
参考答案和解析
B
更多 “5、阅读下面程序,选择正确输出结果_______________。x = 10 y = 20 if x > 10: if y > 20: z = x + y print('z is', z) else: print(x)A.10B.20C.30D.没有输出” 相关考题
考题
设有下面程序段 y:=2; while yy Then z:=x;x:=y;y:=z
Ax=10,y=20,z=30Bx=20,y=30,z=30Cx=20,y=30,z=10Dx=20,y=30,z=20
考题
阅读以下说明,回答问题,将解答填入对应的解答栏内。[说明] 计算下列源代码的McCabe环数,画出控制流程图并用罗马数字标出区域。read x,y,z;type =“scalene”;if (x= =y or x = = z or y= = z)type =“isosceles ”;if (x = = y and x = = z) type =“equilateral”;if (x>= y+ z Or y>= x+20rz>=x+ y) type= “not a triangle”;if (x<=0 or y<= 0 or z <=0) type =“bad inputs”;print type;
考题
有如下程序: DefStr X-Z X="123'’ Y="456" Z=X$+Y$ Print Z$ End 运行后,输出的结果是( )。A.显示出错结果B.123456C.579D.579
考题
以下程序的输出结果是 ( ) fun (int x,int y, int z) { z=x * x+y * y;} main( ) { int a=31; fun(5,2,a); print{("%d",a); }A.0B.29C.31D.无定值
考题
单击按钮时,以下程序运行后的输出结果是 Private Sub proc1(x As Integer,y As Integer,z As Integer) x=3*z y=2*z z=x+y End Sub Private Sub Command1_Click() Dim x As Integer,y As Integer,Z As Integer x=1:y=2:z=3 Call proc1(x,x,z) Print x;x;z Call proc1(x,y,y) Print x;y;y End SubA.6 6 12 `B.9 5 10 6101051010C.9 6 12D.9 10 10 910155410
考题
阅读程序段,当输入数据形式为25,13,10时,正确的输出结果为 ______。 int x, y, z; cin>>x>>y>>z;; cout<< "x+y+z=%d\n" <<x+y+z;A.x+y+z=48B.x+y+z=35C.x+z=35D.不确定值
考题
单击一次窗体之后,下列程序代码的执行结果为______。 Private Sub Command1_ Click() Dim x As Integer, y As Integer, z As Integer x = 1: y = 2: z = 3 Call fun1 (x, y, z) Print x; y; z Call fun2(x, y, z) Print x; y; z End Sub Private Sub fun1(x As Integer, y As Integer, z As Integer) x = 10 * z y=z*z+ x z=x+ y+ z End Sub Private Sub fun2 (ByVal x As Integer, ByVal y As Integer, ByVal z As Integer) x=10*z y=z*z+ x z=x+ y +z End SubA.1 2 3 30 39 72B.1 2 3 1 2 3C.30 39 72 1 2 3D.30 39 72 30 39 72
考题
下列程序段的执行结果为______。 x = 0: y = 1 z = 1: n = 0 Do x = x + y + z n = n + 1 Loop While x < 10 Print x; nA.10 5B.x nC.9 5D.10 6
考题
执行以下程序段 a$ ="abbacddcba" For i = 6 To 2 Step - 2 X = Mid(a, i,i) Y=Left(a, i) z=Right(a,i) z=UCase(X Y Z) Next i Print z 输出结果为A.ABCB.BBABBAC.ABBABAD.AABAAB
考题
下面程序的运行结果是( )。 X=-2.3y=125z=Len(StrS(x)+StrS(y))Print Z A.4B.8
下面程序的运行结果是( )。 X=-2.3y=125z=Len(StrS(x)+StrS(y))Print ZA.4B.8C.9D.3
考题
下面程序: Private Sub Form_Click() Dim x,y,z As Integer x=5 y=7 z=0 CallPI(x,y,z) Print Str(z) End Sub SubP1(By Val a As Integer, By Val b As Integer, c As Integer) C=a+b End Sub 运行后的输出结果为______。A.0B.12C.Str(z)D.显示错误信息
考题
下面程序执行的结果是( )。 CLEAR X=5 Y=6 Z=7 IF X>Y IF Z>8 X=X+Y ELSE X=X+Z ENDIF ENDIF ?XA.5B.11C.12D.13
考题
以下程序运行后,单击按钮输出结果是 Private Sub Commandl_Click( ) Dim x As Integer,y As Integer,z As Integer X=4:y=2: Z=3 Call Gopd(x,x,z) Print x;X;Z Call Gopd(x,y,y) Print x;y;y End Sub Private Sub Gopd(x As Integer,y As Integer,z As Integer) X=3 * Z + 1 y=2 * z z=x + y End SubA.6 6 12 7 11 11B.8 5 10 5 11 11C.9 6 12 9 10 15D.8 10 10 5 9 10
考题
对于下面的程序,说法正确的是 include void main( ) {int x=3,y=4,z=2; i
对于下面的程序,说法正确的是 #include<iostream.h> void main( ) { int x=3,y=4,z=2; if(X=y+z) cout <<"x=y+Z"; else cout<<"x!=y+Z";}A.不能通过编译B.输出6C.输出x! =y+zD.输出x=y+z
考题
单击按钮时,以下列程序运行后的输出结果是 Private Sub proc1(x As Integer,y As Integer,z As Integer) x=3*z y=2*z z=X+y End Sub Private Sub Command1_Click( ) Dim x As Integer,y As Integer,z As Integer x=1:y=2:z=3 Call proc1(x,x,2) Print x;x;z Call proc1(x,y,y) Print x;y;y End SubA.6 6 12 6 6 10B.9 5 10 5 10 10C.9 6 12 9 10 15D.9 5 10 5 4 10
考题
设计下列伪程序的语句覆盖测试用例。 BEGIN INPUT(A,B,C) IF A5 THEN X=10 ELSE X=1 END IF IF B10 THEN Y=20 ELSE Y=2 END IF IF C15 THEN Z=30 ELSE Z=3 END IF PRINT(X,Y,Z) END
考题
执行以下语句后x,y,z的值是()intx=10,y=20,z=30;if(xy){z=x;x=y;y=z;}A、x=10,y=20,z=30B、x=20,y=30,z=30C、x=20,y=30,z=10D、x=20,y=30,z=20
考题
请为下面的程序设计符合判定覆盖的测试用例。 int main() { int a,b,c,x,y,z,t; scanf(“d%,d%,d%”,a,b,c,t); if a5 t1 x=10 else x=1; if b10 y=20 else y=2; if c15 z=30 else z=3; printf(“d%,d%,d%/n”,x,y,z) }
考题
已知intx=10,y=20,z=30;以下语句,if(xy)z=x;x=y;y=z;执行后x,y,z的值是()A、x=10,y=20,z=30B、x=20,y=30,z=30C、x=20,y=30,z=10D、x=20,y=30,z=20
考题
问答题设计下列伪程序的语句覆盖测试用例。 BEGIN INPUT(A,B,C) IF A5 THEN X=10 ELSE X=1 END IF IF B10 THEN Y=20 ELSE Y=2 END IF IF C15 THEN Z=30 ELSE Z=3 END IF PRINT(X,Y,Z) END
考题
填空题已知g=lambdax,y=3,z=5:x*y*z,则语句print(g(1))的输出结果为()。
热门标签
最新试卷