10的阶乘

来源:互联网 发布:量化金融 知乎 编辑:程序博客网 时间:2024/05/02 10:27
Private Sub Command2_Click()
Print 阶乘(10)
End Sub
Private Function 阶乘(n As Integer) As Long
If n = 1 Then
   阶乘 = 1
   Else
   阶乘 = n * 阶乘(n - 1)
   End If

End Function

0 0
原创粉丝点击