下列伪代码输出的结果是____________.I←1While I<8S←2I+3I=I+2End whilePrint

下列伪代码输出的结果是____________.

I←1

While I<8

S←2I+3

I=I+2

End while

Print S

答案

17  第一次循环:S=2×1+3=5,i=3;

第二次循环:S=2×3+3=9,i=5;

第三次循环:S=2×5+3=13,i=7;

第四次循环:S=2×7+3=17,i=9;

此时i≥8,退出循环,∴最终S=17.

相关题目

(2010·福建省石狮石光华侨联合中学高中毕业班5月份高考模
(2010·福建省石狮石光华侨联合中学高中毕业班5月份高考模拟)   27.   A well-written composition__________ a good choice of words and clear organization among other things.
It’s good to make mistakes, and here is why. First of all, mistakes are a cl
It’s good to make mistakes, and here is why. First of all, mistakes are a clear sign that you are trying new things. It’s always good to try new things because when you are trying new things yo
Luckily, he ________these people years ago.A. broke into  B. broke out  C. bro
Luckily, he ________these people years ago.A. broke into  B. broke out  C. broke away from     D. broke down from
 I had my last school trip ______ December 18, 2011. A. at         
 I had my last school trip ______ December 18, 2011. A. at                  B. in                C. on                D. for
算法S1 m=a    S2 若b<m,则m=b    S3 若c<m,则m=d    S4
算法S1 m=a    S2 若b<m,则m=b    S3 若c<m,则m=d    S4 若d<m,则 m=d    S5输出m,则输出m表示 ( )  A.a,b,c,d中的最大值  B.a,b
16世纪时,如果一个英国商人想到印度去收购棉花,他应该走
16世纪时,如果一个英国商人想到印度去收购棉花,他应该走的最近的航线为     A.英国→ 地中海→奥斯曼土耳其控制区→印度   B.英国→大西
 “中华开国五千年,神州轩辕自古传。”下列传说中的发明
 “中华开国五千年,神州轩辕自古传。”下列传说中的发明,属于轩辕的是    ①医药               ②陶器              ③兵器      
下列各句中,加点的成语使用不恰当的一句是( 3分 ) A、旅
下列各句中,加点的成语使用不恰当的一句是( 3分 ) A、旅游和真正意义上的游历完全是两回事。就亲近自然而论,前者是走马观花,行一 时一己之

最新题目