1个回答
展开全部
Private Sub Command1_Click()
Dim a(10) As Integer
For i = 0 To 10
a(i) = i
Next
Print sum(a)
End Sub
Function sum(a() As Integer) As Integer
Dim i As Integer
Dim s As Integer
s = 0
For i = LBound(a) To UBound(a)
s = s + a(i)
Next
sum = s
End Function
Dim a(10) As Integer
For i = 0 To 10
a(i) = i
Next
Print sum(a)
End Sub
Function sum(a() As Integer) As Integer
Dim i As Integer
Dim s As Integer
s = 0
For i = LBound(a) To UBound(a)
s = s + a(i)
Next
sum = s
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询