【求助】VB编程问题
正在练习一道VB题目:输入N,使用循环语句,计算p=1!+2!+3!+…+N!的值(N<=10)N<=10应该怎么放进去???
这是我做的:
Private Sub Command1_Click()
Dim n As Integer, mlt As Long, Sum As Long
n = InputBox("输入n:")
Sum = 0
For i = 1 To n
mlt = 1
For j = 1 To i
mlt = mlt * j
Next
Sum = Sum + mlt
Next
Print "1!+2!+3!...+n! = "; Sum
End Sub
[ 本帖最后由 ajmlgxx 于 2013-11-2 19:48 编辑 ]