VB编写程序,求S=1!+2!+3!,阶乘的计算用函数过程实现 5
1个回答
2015-10-23
展开全部
Private Sub Command1_Click()
Dim s As Double, i As Integer
For i = 1 To 3
s = s + jc(i)
Next i
Print s
End Sub
Function jc(n As Integer) As Double
jc = 1
For i = 1 To n
jc = jc * i
Next i
End Function
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询