(29) 下列程序段的执行结果为
a=6
For k=1 To 0
a=a + k
Next k
Print k; a
A) -1 6
B) -1 16
C) 1 6
D) 11 21
(30) 下列程序段的执行结果为
a=1
b=1
For I=1 To 3
f=a + b
a=b
b=f
Print f;
Next I
A) 2 3 6
B) 2 3 5
C) 2 3 4
D) 2 2 8
(31) 下列过程定义语句中,形参个数为不确定数量的过程是
A) Private Sub Pro3(x As Double,y As Single)
B) Private Sub Pro3(Arr(3),Option x,Option y)
C) Private Sub Pro3(ByRef x,ByVal y,Arr( ))
D) Private Sub Pro3(ParamArray Arr( ))
(32) 单击命令按钮时,下列程序的执行结果为
Private Sub Command1_Click()
Dim x As Integer, y As Integer
x=12: y=32
Call PCS(x, y)
Print x; y
End Sub
Public Sub PCS(ByVal n As Integer, ByVal m As Integer)
n=n Mod 10
m=m Mod 10
End Sub
A) 12 32
B) 2 32
C) 2 3
D) 12 3
(33) 单击一次命令按钮后,下列程序的执行结果是
Private Sub Command1_Click()
s=P(1) + P(2) + P(3) + P(4)
Print s
End Sub
Public Function P(N As Integer)
Static Sum
For i=1 To N
Sum=Sum + i
Next i
P=Sum
End Function
A) 15
B) 25
C) 35
D) 45
(34) 下列程序的执行结果为
Private Sub Command1_Click()
Dim s1 As String, s2 As String
s1="abcdef"
Call Invert(s1, s2)
Print s2
End Sub
Private Sub Invert(ByVal xstr As String, ystr As String)
Dim tempstr As String
i=Len(xstr)
Do While i >=1
tempstr=tempstr + Mid(xstr, i, 1)
i=i - 1
Loop
ystr=tempstr
End Sub
A) fedcba
B) abcdef
C) afbecd
D) defabc