Private Sub Form_Click()
Dim N As Integer, e As Single, I As Integer, J As Integer, Jc As Double
N = Int(Val(InputBox("计算的项数N=", "输入", 5)))
Jc = 1
e = 1
For I = 1 To N
Jc = Jc * I
e = e + 1 / Jc
Next
Print "e=1+1/1!+1/2!+……+1/"; N; "! = "; e
End Sub
已经运行过,有什么问题请留言.