问题 单项选择题

阅读下面的程序段,执行上面的三重循环后,a的值为 ______ 。
For i=1 To 3
For j=1 To i
For k=j To 4
a=a+1
Next k
Next j
Next i

A.9

B.24

C.14

D.20

答案

参考答案:D

解析: a的默认值为0。每进行一次最内层的循环,a的值要加1,因此要得出a的值,主要要分析总的循环次数。
第一层循环要执行3次:
第一次循环i=1时,第二层循环执行1次,其中第三层循环执行4次,共循环4次。
第二次循环i=2时,第二层循环执行2次:其中第一次执行中,第三层循环执行4次;第二次扭行中,第三层循环执行3次;共循环7次。
第三次循环i=3时,第二层循环执行3次:第一次执行中,第三层循环执行4次;第二次执行中,第三层循环执行3次;第三次执行中,第三层循环执行2次;共循环9次。
因此,一共执行4+(4+3)+(4+3+2)=20次循环,a的值等于20。

阅读理解

Mum went to Peter’s bed and said, “I want to borrow Tim’s radio for you.” Peter touched the letter in his pocket and said, “Thanks, Mum ! But you are so tired now.” “Today I want to send you a special gift on the radio. It will surprise you. I will come back soon.” Mum said and quickly left in the heavy snow.

Peter took out the letter. He got it in the afternoon. Mum didn’t know about it. Mum wrote in the letter: The 26th of this month is my son Peter’s birthday. Could you please bless(祝福)him on Happy Family? He has been ill for one month. The radio station wrote on the top: I’m sorry to tell you that we have canceled(取消) this program.

Mum came back with a radio. She walked very slowly. There were lots of snow on her clothes. And the program began quickly.

Next Peter got very surprised. “Originally(原来),we planned to cancel this program, but lots of people like it very much. Now, let’s bless the following people together, Kate, Martin, Linda...”The list was long. Mum was too tired and she fell asleep. Peter didn’t hear his name to the end. But he was quite moved(被感动). He woke up Mum, “Mum, I heard my name just now. They said I am a very good boy. I am very happy. Thank you for your nice birthday gift, Mum!” Mum smiled with tears. Peter also smiled with tears. He believed it was the best birthday gift for him.  

根据短文内容判断正(T) 误(F)

小题1:Mum went out to borrow a radio for Peter.

小题2:It was rainy on Peter’s birthday.

小题3:Mum didn’t know that the radio station had planned to cancel the program.

小题4:Mum was too busy to listen to the program.

小题5:Peter was moved because he heard his name on the radio.

多项选择题