(27) 單擊一次命令按鈕后,下列程序的執(zhí)行結(jié)果為
Private Sub Command1_Click()
Dim m As Integer, I As Integer, x(10) As Integer
For I=0 To 4: x(I) =I + 1: Next I
For I=1 To 2: Call Prioc(x) : Next I
For I=0 To 3: Print x(I) ;: Next I
End Sub
Private Sub Prioc(a() As Integer)
Static I As Integer
Do
a(I) =a(I) + a(I + 1)
I=I + 1
Loop While I < 2
End Sub
A) 3 4 7 5
B) 3 5 7 4
C) 1 2 3 4
D) 1 2 3 5
正確答案: B
(28) 下面程序段的運行結(jié)果是
a=1
b=1
Do
a=a + 1
b=b + 1
Loop Until b > 5
Print "k="; a; Spc(4) ; "b="; b + a
A) k=7 b=14
B) k=6 b=6
C) k=4 b=8
D) k=6 b=12
正確答案: D
相關(guān)推薦:
2009年9月計算機等考二級VB模擬題及解析匯總 在VB中利用遠程數(shù)據(jù)庫的訪問之應(yīng)用舉例