vfp 计算1/1!,1/2!,1/3!.1/10!之和s=0 for i=1 to 10 s=s+1/jc(i) endfor ?“值为”+str(s) func jcparametrs num t=1for n=1 to num t=t*n endforreturn t endfunc错在哪

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/17 18:55:02
vfp计算1/1!,1/2!,1/3!.1/10!之和s=0fori=1to10s=s+1/jc(i)endfor?“值为”+str(s)funcjcparametrsnumt=1forn=1tonu

vfp 计算1/1!,1/2!,1/3!.1/10!之和s=0 for i=1 to 10 s=s+1/jc(i) endfor ?“值为”+str(s) func jcparametrs num t=1for n=1 to num t=t*n endforreturn t endfunc错在哪
vfp 计算1/1!,1/2!,1/3!.1/10!之和
s=0
for i=1 to 10
s=s+1/jc(i)
endfor
?“值为”+str(s)
func jc
parametrs num
t=1
for n=1 to num
t=t*n
endfor
return t
endfunc
错在哪

vfp 计算1/1!,1/2!,1/3!.1/10!之和s=0 for i=1 to 10 s=s+1/jc(i) endfor ?“值为”+str(s) func jcparametrs num t=1for n=1 to num t=t*n endforreturn t endfunc错在哪
s=0
for i=1 to 10
m=jc(i)
s=s+1/m
endfor
?"值为",s
func jc
para num
t=1
for n=1 to num
t=t*n
endfor
return t
endfunc