vb程序填空求1! 2! …… 10!的值
1个回答
展开全部
Public Function jiecheng(ByVal n As Integer) As Double
Dim jc As Double
jc = 1
For i = 1 To n
jc = jc * i
Next
jiecheng = jc
End Function
Private Function Factorial1(intN As Integer) As Integer
'采用递归计算阶乘
If intN = 0 Then
Factorial1 = 1
Else
Factorial1 = Factorial1(intN - 1) * intN
End If
End Function
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询