问题 填空题

以下程序段的功能为,输入8个数给数组a,然后采用插入排序算法,将数组a中的数按照升序排列存入数组b中。请填空。
Private Sub Command1_Click ()
Dim a(1 To 8), b(1 To 8)
For i = 1 To 8
a(i) = InputBox("请输入")
Print a(i)
Next i
Print
For i = 1 To 8
s = 1
For j = 1 To 8
If______Then
s = s + 1
End If
Next j
______
Next i
End Sub

答案

参考答案:a(i)>a(j) b(s)=a(i)

解析: 首先通过InputBox语句输入8个数给数组a。将数组a中的每个元素按顺序与其余 9个元素比较。例如对元素a(1),如果有n个元素小于该元素,则该元素赋值给数组b中的b(n +1)。

阅读理解

阅读理解。

     I heard the bees long before I saw them.

     It was a very hot afternoon, and we decided to cool off in the river near my home. As we climbed

down a small rocky (石头的) hill toward the water, my boyfriend John suddenly started to shout then

jumped into the water below. Peter and Mary quickly followed but I was too far away to jump. I was

trapped.

    I heard a low hum (嗡嗡声),which was growing louder. From a distance (距离), the group of bees

looked almost like a cloud of smoke. As it got closer, I knew it was thousands of bees flying towards

me.

     All I could do was cover my face with hands. Crazily, I thought that if I sat very still, the bees would

think I was just another rock.

     After a few minutes, I  knew  my  plan  didn't work. The bees were attacking me. I  could hear my

friends shouting at me to get down to the pool fast.

     But it wasn't so easy. I was in great pain (疼痛) and the only way I could get away was to use my

hands to climb down the rocks. However, I was afraid to do that at first because  my  face would be

unprotected. The noise the bees made was so loud and frightening, but I had no way. I rushed down

the rocks and jumped into the pool, but  I don't remember doing it. I was just so  happy to  be  free

from the pain. I was safe, and the water felt wonderful.

     But we still weren't out of danger. Every  time  we  tried to  climb out  of  the pool, the bees flew

back over our heads. We spent the next three hours in the water, putting our heads under the water

from time to time to keep away the bees until they finally lost interest.

1. How many people went swimming that day?  

A. Two.    

B. Three    

C. Four    

D. Five

2. The underlined word "it" (in Paragraph 3) refers to        .

A. a rock    

B. the group of bees    

C. a hill    

D. the river

3. At first why didn't the writer want to climb down the rocks?

A. She was afraid she would fall.

B. She was too far away from pool.

C. She thought the bees would follow her.

D. She didn't want her face to be unprotected.

4. How did the writer escape (逃离) the bees?

A. She covered her face with her hands.

B. She hid behind the rocks.

C. She jumped into a water pool.

D. She pretended (假装) to be a rock.

解答题