VFP编写程序,计算:s=1!+2!+3!+.+10!

问题描述:

VFP编写程序,计算:s=1!+2!+3!+.+10!

CLEAR SET TALK Off s1=0 for n=1 to 10s1=s1+jc(n)next "1!+2!+3!+.+10!=",s1 FUNCTION jc PARAMETERS i s=1 FOR j=1 TO i s=s*j endf RETURN s ENDFUNC set talk on