举一反三
- 下面程序段: Dim y If y Then Print y+1 Else Print y+2 运行后,显示的结果是 .
- 编写如下程序: Private Sub Command1_Click() Dim x As Integer, y As Integer x = 1: y = 1 Do y = x * y If y > 10 Then Print x, y Exit Do Else x = x + 3 End If Loop While x <= 10 End Sub 运行程序,输出结果为______
- 如下程序的运行结果是( ) int x = 1, y=1; if(x==1) y= x+1; else if(y==2) x= y+1; else y= 0;
- 下面程序段运行后,显示的结果是( )。Dim x as integer if x then print x else print x+1 A: 显示出错信息 B: 0 C: 1 D: -1
- 运行如下程序,输出结果是 。 try: x, y = 1, 0 z = x / y print(0, end=",") except: print("1", end=",") else: print("2", end=",") finally: print("3", end=",")
内容
- 0
以下程序段中,执行结果与其他3个选项不同的是 A: Dim y As Integer B: y = 11 C: Select Case y D: Case 15 To 5 E: Print "Executed" F: End Select G: Dim y As Integer H: y = 10 I: Select Case y J: Case Is > 10, Is < 10 K: Print " Executed " L: End Select M: Dim y As Integer N: y = 10 O: Select Case y P: Case Is > 15, 1, 5 To 8 Q: Print " Executed " R: End Select S: Dim y As Integer T: y = 10 U: Select Case y V: Case 1, 3, Is > 6 W: Print " Executed " X: End Select
- 1
下列VBA程序段的执行结果为_______________。 X=2 Y=2 IF X*Y<1 THEN Y=Y-2 ELSE Y=Y+2 Debug.Print Y-X>0
- 2
下面程序运行后,y的值是( ) 。 Dim x%,y% x = Int(Rnd) + 3 If x ^ 2 = 9 Then y = x ^ 2 - 2 else y=1
- 3
阅读下列程序,写出运行结果 。#include <;stdio.h>;main ( ){ int x=1, y=10;if(x!=2) y=y+2;else y=y*2;printf("%d", y);}
- 4
下列程序段的输出结果是_____。 x = 10 if x > 5: y = 2 * x elif x > 3: y = 3 * x elif x > 1: y = 4 * x else: y = x print(y)