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
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