VB编写程序计算1+2!+3!+4!+……+10!的程序
2013-07-16
展开全部
Function jc(n As Integer) As Long
Dim i%
jc = 1
For i = 1 To n
jc = jc * i
Next
End Function
Private Sub Command1_Click()
Dim SumAdd As Long, i%
For i = 1 To 10
SumAdd = SumAdd + jc(i)
Next
Print SumAdd
End Sub
Dim i%
jc = 1
For i = 1 To n
jc = jc * i
Next
End Function
Private Sub Command1_Click()
Dim SumAdd As Long, i%
For i = 1 To 10
SumAdd = SumAdd + jc(i)
Next
Print SumAdd
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-07-16
展开全部
Private Sub Form_Click()
s = 1
For i = 2 To 10
s = s + JieCheng(i)
Next i
Print s
End Sub
Function JieCheng(a)
t = 1
For i = 2 To a
t = t * i
Next i
JieCheng = t
End Function
s = 1
For i = 2 To 10
s = s + JieCheng(i)
Next i
Print s
End Sub
Function JieCheng(a)
t = 1
For i = 2 To a
t = t * i
Next i
JieCheng = t
End Function
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询