题型:综合题 题类:模拟题 难易度:困难
浙江省教育绿色评价联盟2018届高三下学期信息技术选考适应性考试试卷
实现上述功能的VB程序如下,但加框处代码有错,请改正。
Const n=10
Private Sub Form_Load()
‘排序前数据存储在数组a中,并在文本框Text1中显示
‘代码略
End Sub
Private Sub Command1_Click()
Dim i As Integer
Dim bottom As Integer
Dim j As Integer
Dim a(1 To n)As Integer
i=1
bottom=n
Do While i<bottom
k=i
j=i+1
Do While i<=bottom
If a(j)=a(k)Then
a(i)=a(bottom)
‘(1)
bottom=bottom-1
E1seIf a(j)<a(k) Then
k=j
End If
j=j+1
Loop
If Then ‘(2)
t=a(i)
a(i)=a(k)
a(k)=t
End If
i=i+1
Loop
‘排序后数据存储在数组a中,并在文本框Text2中显示
End Sub
试题篮