s=0 for i = 1 to 10 step 2 if int(i/3)=i/3 loop endif s=s+i endf s,is=0for i = 1 to 10 step 2if int(i/3)=i/3loopendifs=s+iendfs,i输出结果是s=13 i=11请问s=13是怎么算出来得?
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/13 20:23:28
![s=0 for i = 1 to 10 step 2 if int(i/3)=i/3 loop endif s=s+i endf s,is=0for i = 1 to 10 step 2if int(i/3)=i/3loopendifs=s+iendfs,i输出结果是s=13 i=11请问s=13是怎么算出来得?](/uploads/image/z/13160724-60-4.jpg?t=s%3D0+for+i+%3D+1+to+10+step+2+if+int%28i%2F3%29%3Di%2F3+loop+endif+s%3Ds%2Bi+endf+s%2Cis%3D0for+i+%3D+1+to+10+step+2if+int%28i%2F3%29%3Di%2F3loopendifs%3Ds%2Biendfs%2Ci%E8%BE%93%E5%87%BA%E7%BB%93%E6%9E%9C%E6%98%AFs%3D13+i%3D11%E8%AF%B7%E9%97%AEs%3D13%E6%98%AF%E6%80%8E%E4%B9%88%E7%AE%97%E5%87%BA%E6%9D%A5%E5%BE%97%3F)
xՒJ@_ed
m} >@AB5=DlЋ`Ք2&
njA/^23-3ۀ
6h:@`ͪ@k@-6~q\֏0lCFB rFq>gY}~2@mB#FyKγ<3:lr%H0ZʘJG ˘
&_H4/,~%Kc$|i%Jg
{Ƞ}Gzc
^&N2iEUt
uEԕT½Oȷ̣6>"$5N~+*KgA,7n
s=0 for i = 1 to 10 step 2 if int(i/3)=i/3 loop endif s=s+i endf s,is=0for i = 1 to 10 step 2if int(i/3)=i/3loopendifs=s+iendfs,i输出结果是s=13 i=11请问s=13是怎么算出来得?
s=0 for i = 1 to 10 step 2 if int(i/3)=i/3 loop endif s=s+i endf s,i
s=0
for i = 1 to 10 step 2
if int(i/3)=i/3
loop
endif
s=s+i
endf
s,i
输出结果是s=13 i=11
请问s=13是怎么算出来得?
s=0 for i = 1 to 10 step 2 if int(i/3)=i/3 loop endif s=s+i endf s,is=0for i = 1 to 10 step 2if int(i/3)=i/3loopendifs=s+iendfs,i输出结果是s=13 i=11请问s=13是怎么算出来得?
i=1时,不满足int(i/3)=i/3的条件,S=0+1=1
i=3时,int(i/3)=1=i/3,满足int(i/3)=i/3的条件,直接进入下一循环
i=5时,不满足int(i/3)=i/3的条件,S=1+5=6
i=7时,不满足int(i/3)=i/3的条件,S=6+7=13
i=9时,int(i/3)=3=i/3,满足int(i/3)=i/3的条件,直接进入下一循环
i=11时,超出循环的范围,结束
最后S=13