题型:综合题 题类:模拟题 难易度:困难
浙江省普通高校招生信息技术选考模拟卷(五)
Const n = 10
Dim a(1 To n) As Integer
Private Sub Command1_Click()
Dim i As Integer, j As Integer, t As Integer
Dim bottom As Integer
'获取排序前数据依次存储在数组a中,并在文本框Text1中显示。代码略
bottom = n
i = 1
Do While i <= bottom - 1
For j = bottom To i + 1 Step -1
If Then
t = a(j): a(j) = a(j - 1): a(j - 1) = t
ElseIf a(j) = a(j - 1) Then '相邻两个数据相等,进行剔除处理
bottom = bottom - 1
End If
Next j
i = i + 1
Loop
Text2.Text = " "
For i = 1 To bottom
Text2.Text = Text2.Text + Str(a(i))
Next i
End Sub
试题篮