问题 单项选择题

在窗体中添加1个命令按钮(其Name属性为Command1)和1个标签(其Name属性为Lable1),然后编写如下代码:
Private Sub Commandl_Cliek()
Dim arrayl(10, 10)As Integer
Dim i, j, Sum AsInteger
Sum=0
For i=1 To 10
Forj=1 To 10
arrayl(i, j)=i+j
Nextj
Next i
End Sub
此程序的功能是求数组arrayl主对角线元素的和,并把结果显示在标签中,为实现此功能,省略号处的程序段应该是 ( )

A.For i=1 To 10
For j=1 To 10
If i=j Then
Sum = Sum+ arrayl (i,j)
End If
Next j
Next i
Labelt. Caption=Sum

B.For i=l TO 10
Forj=1 To 10
If i= =j Then
Sum=Sum+array1 (i,j)
End If
Next j
Next i
Labell. Caption=Sum

C.For i=1 To 10
For j=1 To l0
If i=j Then
Sum=Sum+arrayl (i,j)
End If
Next i
Next j
Lahell. Caption=Sum

D.For i=1 To 10
For j=1 To l0
If i=j Then
Sum=arrayl (i,j)
End If
Next j
Next i
Labell. Caption=Sum

答案

参考答案:A

解析: 选项B中条件表达式i= =j有误,在VB中表示i等于j,应写成i=j。排除选项B。选项C中的For......Next语句使用有误,内层应该是Next j,外层为Next i。选项D中的求和语句有误。应为Sum= Sum+array1(i,j)。只有A项是正确的。

阅读理解

阅读理解。

      What do pen pals write in the letters? In the children's letters, they often write about their school days, hobbies, and favorite stars. They may be from different(不同的)countries, and they may have lots of things to tell their pen pals. Some of them also send letters with their photos, and then their friends can "see" their life.

     Many Chinese children are amazed to see their American friends are so free(自由) and relaxed at

school. They don't have much homework. They are also amazed to see American students go to school

in all kinds of funny clothes.

     The American students are amazed to see their Chinese friends are good at all subjects. They think

Chinese words are too difficult, but their Chinese friends can write them well.

     Pen pals can know many new things from the letters. So they often write to each other(互相).

1. Pen pals often write about _____ in their letters.  

A. school days

B. hobbies

C. favorite stars

D. all above (以上全部)

2. Some of the pen pals also send _____ in their letters, and then their friends can "see" their life.

A. stamps(邮票)

B. food

C. photos

D. clothes  

3. According to the passage, American students wear _____ to go to school. 

A. school uniforms

B. only T-shirts

C. only jeans

D. all kinds of funny clothes  

4. The American students think Chinese words are too _____.

A. easy(简单的)

B. hard

C. interesting

D. beautiful

5. The underlined word "amazed" means "_____" in Chinese. 

A. 惊讶的

B. 愉快的

C. 困难的

D. 愚昧的

填空题