1+1/2!+1/3!+1/4!+…+1/n!的结果在vfp中怎么用程序表示
2个回答
展开全部
CLEAR
SET DECIMALS TO 12
LOCAL i, e
e = 1
FOR i = 1 TO 20
e = e + 1/m_Factorial(i)
ENDFOR
? "e=",e
SET DECIMALS TO 2
RETURN
&& 阶乘函数
PROCEDURE m_Factorial(n)
IF n < 0
RETURN -1
ENDIF
IF n = 0
RETURN 1
ENDIF
n = INT(n)
LOCAL i, nFactorial
nFactorial = 1
FOR i = 1 TO n
nFactorial = nFactorial * i
ENDFOR
RETURN nFactorial
ENDPROC
展开全部
设bn=1+2+3+4+......n=1/2﹙n+n2﹚
2000=1+2+3+4+......62+47
S2000=b1+b2+b3+b4+......b62+b47
=1/2×﹙1+2+3+4+......62﹚+1/2﹙11+22+32+42+......622﹚+1/2﹙47+472﹚
=1/2×62×63/2+1/2×62×63×﹙2×62+1﹚/6+1128
=42792
记得加分啊,谢谢
2000=1+2+3+4+......62+47
S2000=b1+b2+b3+b4+......b62+b47
=1/2×﹙1+2+3+4+......62﹚+1/2﹙11+22+32+42+......622﹚+1/2﹙47+472﹚
=1/2×62×63/2+1/2×62×63×﹙2×62+1﹚/6+1128
=42792
记得加分啊,谢谢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询