1. 执行下列的程序段,得到的X的值为
Dim x As String
n = Int(Rnd)*10
Select Case n
Case 10
x = “ 优 ”
Case 9
x = “ 良 ”
Case 8
x = “ 合格 ”
Case Else
x = “ 不合格 ”
End Select
2. 执行下列的程序段,得到的X的值为
Dim x As String
For i = 1 to 3
x = 4
For j = 1 to 4
x = x + 5
Next j
Next i
3. 执行下列的程序段,得到的X的值为
Dim A As String, B As Long, C As Double
A = 100.1; B = 200.2; C = 300.3
X = A + B + C
4. 执行下列的程序段,得到的X的值为
Dim a(10) As integer,p(3) As integer
x = 0
For i = 1 to 10
a(i) = i + 1
Next i
For i = 1 to 3
p(i) = a (i*i)
Next i
For i = 1 to 3
x = x + p(i) * 2
Next i
5. 执行下列的程序段,输出的结果为
Public Sub Swap1(ByVal x As Integer, ByVal y As Integer)
Dim t As Integer
t=x : x=y : y=t
End Sub
Public Sub Swap2(x As Integer,y As Integer)
Dim t As Integer
t=x : x=y : y=t
End Sub
Private Sub Command1_Click()
Dim a As Integer, b As Integer
a=10: b=20
Swap1 a , b
Swap2 a,b
Print a,b
End Sub