VB中的fun((i))是什么意思。题目如下。不要只是答案,求解释fun((i))的意思
OptionExplicitPrivateSubCommand1_Click()DimiAsInteger,sAsIntegerFori=1To9Step3s=fun((...
Option Explicit
Private Sub Command1_Click()
Dim i As Integer, s As Integer
For i = 1 To 9 Step 3
s = fun((i)) + fun(i)
Print s
Next i
End Sub
Private Function fun(m As Integer) As Integer
Static a As Integer
If m Mod 2 = 0 Then
a = a + 1
m = m + 1
Else
a = a + 2
m = m + 2
End If
fun = a + m
Print fun
End Function 展开
Private Sub Command1_Click()
Dim i As Integer, s As Integer
For i = 1 To 9 Step 3
s = fun((i)) + fun(i)
Print s
Next i
End Sub
Private Function fun(m As Integer) As Integer
Static a As Integer
If m Mod 2 = 0 Then
a = a + 1
m = m + 1
Else
a = a + 2
m = m + 2
End If
fun = a + m
Print fun
End Function 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询