(32) 單擊命令按鈕時,下列程序的執(zhí)行結(jié)果是
Private Sub Book(x As Integer)
x=x * 2 + 1
If x < 6 Then
Call Book(x)
End If
x=x * 2 + 1
Print x;
End Sub
Private Sub Command2_Click()
Book 2
End Sub
A) 23 47
B) 10 36
C) 22 44
D) 24 50
正確答案: A
(33) 有如下程序:
Private Sub Command1_Click()
Dim k As Integer, m As Integer
Dim p As Integer
k=4: m=1
p=PC(k, m) : Print p;
p=PC(k, m) : Print p
End Sub
Private Function PC(a As Integer, b As Integer)
Static m As Integer, i As Integer
m=0: i=2
i=i + m + 1
m=i + a + b
PC=m
End Function
程序運行后,輸出的結(jié)果為
A) 4 6
B) 6 6
C) 8 8
D) 10 12
正確答案: C
相關(guān)推薦:
2009年9月計算機(jī)等考二級VB模擬題及解析匯總 在VB中利用遠(yuǎn)程數(shù)據(jù)庫的訪問之應(yīng)用舉例