单项选择题
在窗体上添加一个命令按钮Command1,编写代码如下:
Function f(x As Integer)
x = x + 3
f = x
End Function
Private Sub Command1_Click()
Dim a(10) As Integer
Dim x As Integer
For i = 1 To 10
a(i) = 8 + i
Next
x = 2
Print a(f(x) + x)
End Sub
程序运行后,单击命令按钮,显示结果为( )。
A.15
B.18
C.12
D.17