vfp中K!+(K+1)!+……M!里面的!下面程序的执行流程:clearinput"请输入K值:" TO Kinput"请输入M值:" TO Ms=0for r =k to mdo sub with a,rs=s+aendfor"S的值为:",sreturnprocedure subparameters p,np=1for l=1 to np=p*lendforreturn
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/18 10:37:52
vfp中K!+(K+1)!+……M!里面的!下面程序的执行流程:clearinput"请输入K值:"TOKinput"请输入M值:"TOMs=0forr=ktomdosubwitha,rs=s+aen
vfp中K!+(K+1)!+……M!里面的!下面程序的执行流程:clearinput"请输入K值:" TO Kinput"请输入M值:" TO Ms=0for r =k to mdo sub with a,rs=s+aendfor"S的值为:",sreturnprocedure subparameters p,np=1for l=1 to np=p*lendforreturn
vfp中K!+(K+1)!+……M!里面的!
下面程序的执行流程:
clear
input"请输入K值:" TO K
input"请输入M值:" TO M
s=0
for r =k to m
do sub with a,r
s=s+a
endfor
"S的值为:",s
return
procedure sub
parameters p,n
p=1
for l=1 to n
p=p*l
endfor
return
vfp中K!+(K+1)!+……M!里面的!下面程序的执行流程:clearinput"请输入K值:" TO Kinput"请输入M值:" TO Ms=0for r =k to mdo sub with a,rs=s+aendfor"S的值为:",sreturnprocedure subparameters p,np=1for l=1 to np=p*lendforreturn
!是阶乘的意思,也不是vfp里面的.
比如 5!=5*4*3*2*1
4!=4*3*2*1
7!=7*6*5*4*3*2*1