麻烦帮帮忙,急用:(下面程序求1!+2!+3!+4!+5!,请将程序补充完整)SET TALK OFFCLEAR________________FOR I=1 TO 5K=1____________S=S+KENDFORSETTALK ONRETURNPROCEDUREJC____________M,NFORJ=1 TO MN=N*JENDFORRETURN
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 13:07:53
麻烦帮帮忙,急用:(下面程序求1!+2!+3!+4!+5!,请将程序补充完整)SET TALK OFFCLEAR________________FOR I=1 TO 5K=1____________S=S+KENDFORSETTALK ONRETURNPROCEDUREJC____________M,NFORJ=1 TO MN=N*JENDFORRETURN
麻烦帮帮忙,急用:(下面程序求1!+2!+3!+4!+5!,请将程序补充完整)
SET TALK OFF
CLEAR
________________
FOR I=1 TO 5
K=1
____________
S=S+K
ENDFOR
SETTALK ON
RETURN
PROCEDUREJC
____________M,N
FORJ=1 TO M
N=N*J
ENDFOR
RETURN
麻烦帮帮忙,急用:(下面程序求1!+2!+3!+4!+5!,请将程序补充完整)SET TALK OFFCLEAR________________FOR I=1 TO 5K=1____________S=S+KENDFORSETTALK ONRETURNPROCEDUREJC____________M,NFORJ=1 TO MN=N*JENDFORRETURN
这里似乎主程序即可完成所需的计算?
SET TALK OFF
CLEAR
________________S=0
K=1 /*这句位置应该在循环外*/
FOR I=1 TO 5
____________K=K*I
S=S+K
ENDFOR
S /*运行到这里,已经输出1!+2!+3!+4!+5!的值了?*/
SETTALK ON
RETURN
PROCEDURE JC /*这个过程起什么作用?这里不能没有空格吧?*/
____________M,N INPUT M
FORJ=1 TO M
N=N*J
ENDFOR
RETURN