(單選,填字母:A.Forml=“紀念品分組“/B.Forml.Name=“紀念品分組“/C.Forml.Caption=“紀念品分組“/D.Forml.Text=“紀念品分組“)。 (2)實現(xiàn)上述功能的VB程序如下,請在橫線處填入合適的代碼;并且加框處代碼有錯,請改正。 Private Sub Command1_Click( ?。?br /> Dim a(1 To 1000),n As Integer,w As Integer,cnt As Integer Dim i As Integer,j As Integer,t As Integer Dim s As String,ch As String Dim p As Integer,q As Integer s=Text1.Text:w=Val(Text2.Text):n=0 For i=1 To Len(s) ch=Mid(s,i,1) If ch=“,“Then n=n+1:a(n)=t:t=0 Else t=
①
①
End If Next i For i=n To 2 Step-1 For j=1 To'② If a(j)<a(j+1)Then t=a(j):a(j)=a(j+1):a(j+1)=t End If Next j Next i cnt=0 p=1:q=n Do While p<q cnt=cnt+1 If
③
③
Then p=p+1:q=q-1 Else o=p+1 End If Loop If p=q Then cnt=cnt+1 Label2.Caption=Str(cnt) End Sub (3)若在文本框Text1中輸A“50,30,100,70,80,40,50,20,“,文本框Tcxt2中輸“110”,單擊“分組”按鈕,標簽Labe12中顯示的內(nèi)容是