vb简单编程: 求自然对数e的近似值,当任意项的值小于10^(-4)是结束运算.用公式e=1+1/1!+1/2!+1/n
PrivateSubCommand1_Click()Dima#,s#,e%a=1s=1Dos=s*at=1/se=e+ta=a+1LoopWhiles>10000Prin...
Private Sub Command1_Click()
Dim a#, s#, e%
a = 1
s = 1
Do
s = s * a
t = 1 / s
e = e + t
a = a + 1
Loop While s > 10000
Print "e="; e
End Sub
错在哪?求分析错误程序 展开
Dim a#, s#, e%
a = 1
s = 1
Do
s = s * a
t = 1 / s
e = e + t
a = a + 1
Loop While s > 10000
Print "e="; e
End Sub
错在哪?求分析错误程序 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询