s=1 for i=1 to 5 step 2 s=s+i endfor s

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/09 18:10:44

s=1 for i=1 to 5 step 2 s=s+i endfor s
s=1 for i=1 to 5 step 2 s=s+i endfor s

s=1 for i=1 to 5 step 2 s=s+i endfor s
s=1 将s赋值为1
for i =1 to 5 step 2 i循环从1到5,每次跳2,即i的值只能是1,3,5,循环3次
s= s + i 循环中,将s+i的值赋值为s
最后s = 1 + 1 + 3 + 5 =10