Y=1/2!+1/3!+1/4!+...+1/n!VB编程当通项小于10^(-7)停止计算
问题描述:
Y=1/2!+1/3!+1/4!+...+1/n!VB编程当通项小于10^(-7)停止计算
Y=1/2!+1/3!+1/4!+...+1/n!编程当通项小于10^(-7)停止计算
答
private sub command1-click()
dim n%,y#,s&
n=2:y=0:s=1
do
s=s*n
y=y+1/s
n=n+1
loop until 1/s