问题 单项选择题

在窗体上放置一个命令按钮Command1,并编写下列单击事件的程序: Option Base 1 Pdvate Sub Command1_Click() Dim c As Integer,d As Integer d=0 c=6 X=Array(2,4,6,8,10,12) For i=1 To 6 If X(i)>c Then d=d+X(i) c=X(i) Else d=d-c End If Next i Print d End Sub 程序运行后,单击命令按钮,则在窗体上输山的结果是( )。

A.10

B.12

C.16

D.20

答案

参考答案:B

解析: 程序首先使用Array函数为x数组变量赋值,然后利用For循环和If结构语句实现程序功能。程序执行过程如下: ①当i=1时,X(i)=2,d=d-c=-6;②当i=2时,X(i)=4,d=d-c=-12;③当i=3时,X(i)=6,d=d-c=-18;④当i=4时,X(i)=8,d=d+X(i)=-10,c=8;⑤当i=5时,X(i)=-10,d=d+X(i)=0,c=10;⑥当i=6时,X(i)=12,d=d+X(i)=12,c=12。

阅读理解

     There is a wonderful story about a young girl who had no family and no one to love her.

     One day, feeling very sad and lonely, she was walking through a grassland when she noticed a small

butterfly caught in a thorn (荆棘) bush. The young girl carefully released the butterfly. Instead of flying

away, the little butterfly changed into a beautiful fairy. The young girl rubbed her eyes in disbelief.

     "For your wonderful kindness," the good fairy said to the girl, "I will give you any wish you would like." The little girl thought for a moment and then replied, "I want to be happy."

     The fairy leaned toward her and whispered in her ear. Then the fairy disappeared.

     As the little girl grew up, there was no one in the land as happy as she. Everyone asked her secret of

happiness. She would only smile and answer, "The secret of my happiness is that I listened to a good fairy when I was a little girl."

     When she was very old and on her deathbed, the neighbors all gathered around her, that her

unbelievable secret of happiness would die with her. "Tell us, please," they begged, "Tell us what the

good fairy said." The lovely old woman simply smiled and said, "She told me that everyone, no matter

how secure they seemed, no matter how old or young, how rich or poor, had need of me."      

1. ______ the girl felt sad and lonely.

A. There were many friends but

B. There was nobody to love her so

C. There was nothing to do

D. Seeing the butterfly was caught

2. Noticing the butterfly was caught by the thorn, the orphan girl ______.

A. helped the butterfly escaped from the thorn

B. felt sorrow, but she didn't go up to help it

C. fell down on it too

D. failed to help it release from the thorn

3. The only thing that the little girl wanted was________.   

A. to be rich                      

B. to have her own parents

C. to have a lot of friends            

D. happiness

4.The neighbors all gathered around the old happy woman when she was dying,because ______.

A. they loved this woman deeply and they didn't wanted her to die

B. the woman had lots of money to be shared as soon as she died

C. they wanted to know the secret of her lifetime happiness

D. they wanted to pray for her after her death

单项选择题