Function Factorial(A, B) As Long
Dim S&
If A > B Then Factorial = 1: Exit Function
For i = 1 To A
S = S + Factorial(A + 1, B)
Next i
Factorial = IIf(S = 0, 1, S)
End Function
Sub Test()
MsgBox Factorial(2, 6)
End Sub作者: singo1232001 時間: 2021-7-29 02:19