vb编程实现求sum=1/1!+1/2!+1/3!+ +1/n! (n
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 19:45:10
vb编程实现求sum=1/1!+1/2!+1/3!+ +1/n! (n
vb编程实现求sum=1/1!+1/2!+1/3!+ +1/n! (n
vb编程实现求sum=1/1!+1/2!+1/3!+ +1/n! (n
Private Sub Command1_Click()
Dim n As Integer,i As Integer
Dim x As Variant,sum As Double
n = 20
x = CDec(x)
x = 1
For i = 1 To n
x = x * i
sum = sum + 1 / x
Next
MsgBox sum
End Sub