1+11+111+1111+N怎么算

问题描述:

1+11+111+1111+N怎么算

Private Function Add(Byval n As Integer) As Long
Dim Sum As Long
Sum = Sum + n
If n > 1 Then
Sum = Sum + Add(n-1)
End if
Add = Sum
End Function