问题 单项选择题

有如下程序:
Private Sub Form_Click()
Dim i As Integer,Sum As Integer
  Sum=0
  For i=2 To 10
    If i Mod 2=0 And i Mod 3<>0 Then
      Sum=Sum+i
    End If
  Next
  Print Sum
End Sub
程序运行后,单击窗体,输出结果为

A.12

B.30

C.24

D.18

答案

参考答案:C

解析:[命题目的] 考查考生对IF条件语句的掌握程度。
[解题要点] 纵观题目可以看出,本题程序段的作用是将从2到10中是2的倍数但不是3的倍数的数求和然后输出。在2到10中满足条件的数字是2,4,8,10,所以和是24,故本题的正确答案是选项C)。
[考点链接] 流程控制结构的方法。

阅读理解

One evening Charlie was on his way home from the railway station. When he turned round a corner, he heard footsteps behind him and he thought someone was coming near. He began to walk fast. The footsteps came fast, too. He slowed down. The footsteps also slowed down. Now he was sure that someone must be going after him. He tried to hide. Still the steps followed him. He didn't know how to save himself, so he jumped over some tall grass and hid himself in a cemetery(墓地). He threw himself down on one of tombs(坟墓).

The man behind came near. Charlie could hear the man jump over the grass. Thoughts of thieves and robbers filled his mind. Charlie stood up and faced the man. "What do you want? Why are you coming after me?" He asked.

"I say," the stranger asked, "do you always go home like this, or are you taking some special exercise tonight? I want to go to Mr. Green's and don't know the way. The station master told me to follow you as you live next door. Excuse me for asking, but is there much farther to go before we get there?"

小题1: That day Charlie was ____.

A.leaving the station for a cemetery

B.walking slowly along the street

C.on his way to Mr. Green's house

D.on his way back home小题2:When he found someone following him, Charlie ____.

A.was too frightened to move

B.stopped to ask the man why

C.hid himself in a cemetery

D.knew clearly what to do小题3: Charlie went into a cemetery because he ____.

A.tried to get rid of the stranger

B.got tired after a day's walk

C.walked too fast and lost

D.wanted to hide his things there小题4:When the stranger followed him into the cemetery, Charlie thought ____.

A.the stranger would ask him the way

B.the stranger would come to stay with him

C.he was in danger of losing his money or even his life

D.he could be asked about Mr. Green小题5: The stranger followed Charlie because ____.

A.he wanted to kill Charlie.

B.he wanted to steal things.

C.he wanted to go to Charlie's place.

D.he wanted to go to Mr. Green's and he didn't know the way there.

问答题 简答题