實現(xiàn)上述功能的VB代碼如下,但加框處代碼有錯,請改正. Dim A(1To 10)As Integer′用于保存10個按從小到大順序排列的整數(shù) ′Form-Load事件過程產(chǎn)生10個整數(shù),按升序保存在數(shù)組A中,并在標簽Label1中顯示 Private Sub Form-Load ( ?。?br />′代碼略 End Sub Private Sub Command1-Click ( ?。?br />Dim I As Integer,j As Integer,m As Integer,k As Integer Dim x As Integer,f As Boolean′變量f用于標記是否在數(shù)組中找到x x=Val(Text1.Text) i=1:j=10 f=False Do While (i<=j)And (f=False) m=Int((i+j)/2) If A(m)=x Then f=True If Then i=m+1Else j=m-1′(1) Loop If f=True Then For k=m To 9 ′(2) Next k Label2.Caption=”” For k=1to 9 Label2.Caption=Label2.Caption+Str(A(k))+”” Next k Else Label2.Caption=”該數(shù)沒有找到” End If End Sub.