實現(xiàn)上述功能的VB程序如下,但加框處代碼有錯,請改正。 Const n=10 Dim a(1 To n) As Integer Private Sub Command1_Click ( ?。?br />Dim i As Integer,j As Integer,t As Integer Dim k As Integer,bottom As Integer ’獲取排序前數(shù)據(jù),依次存儲在數(shù)組a中,并在文本框Text1中顯示。代碼略 bottom=n:i=1 Do While i<=bottom-1 k=i:j=bottom Do While j>i If a(j)<a(k) Then k=j ElseIf a(j)=a(i) Then’若發(fā)現(xiàn)重復(fù)數(shù)據(jù),進(jìn)行剔除處理 a(j)=a(bottom) If k=bottom Then’(1) bottom=bottom-1 End If j=j-1 Loop If k<>i Then t=a(k):a(k)=a(i):a(i)=t ’(2) End If i=i+1 Loop Text2.Text=““ For i=1 To bottom Text2.Text=Text2.Text+Str(a(i)) Next i End Sub