怎么用VB计算N的阶层

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/26 23:24:11
怎么用VB计算N的阶层
x){dg)+œ^[|tZ^tcMR>^y;&%d)%&e&h)8+x敤i>y` @E(CHVĄ +AB&\/ !y) 0$ف~-

怎么用VB计算N的阶层
怎么用VB计算N的阶层

怎么用VB计算N的阶层
Function factorial(n As Integer) As Long
Dim i As Integer
Dim ret As Long
ret = 1
For i = 1 To n
ret = ret * i
Next i
factorial = ret
End Function