Private sub command1_click()
Dim a(1 to 20) as integer,b(1 to 20) as integer,i as integer
Dim j as integer,t as integer,p as integer,k as integer,xiaofen as integer
‘从文本框读取AB两队各场的比分分别存数组a、b,场次k,代码略
For i=1 to k-1
For j= 1 to ①
If ② then
t=a(j):a(j)=a(j+1):a(j+1)=t
t=b(j):b(j)=b(j+1):b(j+1)=t
End if
Next j
Next i
p=0 : xiaofen=0
For i=1 to k
If a(i)>b(i) then ③
xiaofen = xiaofen+a(i)-b(i)
List1.Additem str(a(i)) + “:”+ str(b(i))
Next i
If p*2>k or k=p*2 and xiaofen>0 then
Text2.text = “A队获胜”
Elseif then
Text2.text = “B队获胜”
Else
Text2.text = “两队平局”
End if
End sub
① ② ③