dim team(7) as string,i%,iA%,iB%
randomize
for i=0 to 7
if int(rnd*2)=0 and iA<4 then
team(i)="A"
iA=iA+1
elseif iB<4 then
team(i)="B"
iB=iB+1
else
team(i)="A"
end if
next
for i=0 to 7
if team(i)="A" then
print "第" & i+1 & "支队伍为A小组"
else
print "第" & i+1 & "支队伍为B小组"
endif
next