A: 100
B: 20
C: 1000
D: 0
举一反三
- 下列程序执行后,变量x的值为( )。 Dim a,b,c,d As Single Dim x As Single a=100 b=20 c=1000 If b>a Then d=a:a=b:b=d End If If b>c Then x=b Elseif a>c Then x=c Else x=a End If A: A) 100 B: B) 20 C: C) 1000 D: D) 0
- 下列程序执行后,变量x的值为( )。 Private Sub command1_click() Dim a, b, c, d As Single Dim x As Single a = 100: b = 20: c = 1000 If b > a Then d = a: a = b: b = d End If If b > c Then x = b ElseIf a > c Then x = c Else x = a End If End Sub
- 下列程序执行后,变量a的值为______。 dim a, b, c, d as single a=100 b=20 c=1000 if b>a then d=a: a=b: b=d end if if c>a then d=a: a=c: c: d end if if c>b then d=b: b=c: c=d end if A: 0 B: 1000 C: 20 D: 100
- 执行下列程序段后,变量y的值为( )。 Dim x As Integer,y As Integer x = 7 y = 3 If x >= 10 Then y = x - y ElseIf x>= 7 Then y = x + y Else y = x End If A: 21 B: 10 C: 4 D: 3
- 下列程序执行后,变量a的值为______。 Dim a,b,c,d As Single a=10:b=20:c=40 If b>a Then d=a:a=b:b=d End If If c>a Then d=a:a=c:c=d End If If c>b Then d=b:b=c:c=d End If A: 10 B: 40 C: 20 D: 100
内容
- 0
完成以下功能:计算分段函数完成程序。 x2+1 (x<0) y= 2x+1 (0≤x<1) 3x3 (x≥1) Private Sub Command1_Click() Dim y As Single, x As Single x = InputBox("请输入x的值") If x() Then y = x * x + 1 () x < 1 Then y = 2 * x + 1 Else y = 3 * x ^ 3 End If Print x; y End Sub
- 1
下列程序运算后,Label1结果显示的是: Dim x As Integer Dim S As String x = 20 S = "2020" x = x Mod 3 Select Case x Case 0 Label1.Text = "A" Case 1 Label1.Text = "B" Case 2 Label1.Text = "C" Case Else Label1.Text = "D" End Select
- 2
下面哪个定义了一个整型变量x A: Dim x As Single B: Dim x As Integer
- 3
写出下列程序的运行结果。 Private Sub Form_Click() Dim x%, y% x = InputBox("请输入一个整数") If x <= 30 And x > 10 Then If x > 20 Then If x < 25 Then y = 10 Else y = 20 End If Else If x > 15 Then y = 30 Else y = 50 End If End If End If Print y End Sub 假设输入18,则运行结果为
- 4
设有如下两个过程: Private Sub Form_Click() Dim x!,y! x = 18: y = 10 Call PPP((x), y) Print x,y End Sub Private Sub PPP(a As Single, b As Single) a = a + b Print a,b b = a + b Print a,b End Sub 运行程序后, 则输出结果是________