使用递归

有1例 1000 每增加1例增加500 


Public Function js(a As Integer) As Integer
Dim i, j, s
j = 500
s = 1000
If a <= 1 Then
js = a * s
Else
js = js(a - 1) + s + j * (a - 1)
End If

End Function
菊子曰 用菊子曰博客,就是爽!
posted @ 2013-06-14 23:11  河之洲  阅读(103)  评论(0编辑  收藏  举报