在窗体上画一个命令按钮,其名称为command1,然后编写如下程序:
PrivateSubCommand1_Click()Dima(10)AsIntegerDimxAsIntegerFori=1To10a(i)=8+iNextx=2Prin...
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
Function f(x As Integer)
x = x + 3
f = x
End Function
程序运行后,单击命令按钮,输出结果为()
a12 b15 c17 d18
为什么? 展开
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
Function f(x As Integer)
x = x + 3
f = x
End Function
程序运行后,单击命令按钮,输出结果为()
a12 b15 c17 d18
为什么? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询