s=0
for i=1 to 10
input "请输入一个数:" to x
s=s+x
endfor
?"它们的和是:",s
试编写代码如下:
*求11+21+31+……201的累加SET TALK OFF
clear
iTotal = 0
i=1
DO WHILE i<=20
iTotal = iTotal + (i*10+1)
? iTotal, i, (i*10+1)
i= i+1
ENDDO
? iTotal
SET TALK ON
代码运行结果:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)