题型:综合题 题类:模拟题 难易度:困难
浙江省宁波市镇海中学2020届高三6月信息技术考前模拟试卷
Dim a(1 To 100) As Integer, n As Integer
Function moving( start As Integer, finish As Integer, st As Integer)
'将元素 a(finish)插入到元素 a(start)和元素 a(start+st)之间
Dim i As Integer, k As Integer k = a(finish)
For i = finish - st To start Step -st a(i + st) = a(i)
Next i a(start) = k
End Function
Private Sub Command1_Click()
Dim head As Integer, end1 As Integer, i As Integer, ans As String
' 将待排序的数存储在数组 a 的 a(1)至 a(n)中,并输入元素个数 n,代码略
head = 1: end1 = n + 1
Do While head < end1
If ① Then
For i = 1 To head - 1
If a(i) > a(head) Then Exit For
Next i
Call moving(i, head, 1)
head = ②
Else
For i = end1 To n
If a(i) < a(head) Then Exit For
Next i
Call moving( ③ )
End1 = end1 - 1
End If
Loop
For i = 1 To n
ans = ans + Str(a(i))
Next i
Text2.Text = ans End Sub 请回答下列问题:
① ② ③
试题篮