问题 单项选择题


说明:阅读下列程序(段)并回答问题,在每小题提供的若干可选答案中,挑选一个正确答案。

【程序】
SET TALK OFF
STORE 0 TO X,Y
DO WHILE X<20
X=X+Y
Y=Y+2
&& IF Y=4
&& EXIT
&& ENDIF
ENDDO
X,Y
SET TALK ON
RETURN

Y的输出结果为 ______。

A.20

B.21

C.22

D.10

答案

参考答案:D

解析: 本程序共执行5次DO WHILE循环,第一次当X=0时,执行循环体后X=0,Y=2,第二次当X=0时,执行循环体后X=2,Y=4,第三次当X=2时,执行循环体后X=6,Y=6,第四次当 X=6时,执行循环体后X=12,Y=8,第五次当X=12时:执行循环体后X=20,Y=10,当X=20时,不满足DO WHILE循环条件X<20,所以退出循环体。

问答题

按要求完成下列各题。

1. Sam: How about trying the new French restaurant tonight?

   Tom: I heard it's very expensive. 

   Sam: Why don't we go Dutch? 

   Tom: Good idea!

    Read the dialogue, can you guess the meaning of "go Dutch"? You may answer it in Chinese. 

                                                                                                                                        

2. Sue is 5 years older than her younger brother Paul. Paul is 6 years older than Jim, the youngest in the family.

    If the total of the children's ages is 32, how old is the eldest child? 

                                                                                                                                         

3. What number should replace the question mark in the last circle? 

      

                                                                                                                                           

4. Which letter should appear in the final medal?

                                          

                                                                                                                                            

5. Look at the shapes and codes given. Work out the code which matches the shape given at the end of the line.

      

                                                                                                                                              

单项选择题