1樓:李慶錦
推薦答案今天 14:15
private sub command1_click()
dim team(8), teama(4), teamb(4) as string, i%, j%
team(1) = "中國"
team(2) = "美國"
team(3) = "巴西"
team(4) = "古巴"
team(5) = "俄羅斯"
team(6) = "荷蘭"
team(7) = "德國"
team(8) = "西班牙"
for i = 1 to 8
x = int((9 - i) * rnd + 1) '剩餘隨機選擇
if i > 4 then
teama(i - 4) = team(x)
else
teamb(i) = team(x)
end if
for j = x to 8
if j < 8 then team(j) = team(j + 1)
next
next
text1.text = teama(1) & space(2) & teama(2) & space(2) & teama(3) & space(2) & teama(4)
text2.text = teamb(1) & space(2) & teamb(2) & space(2) & teamb(3) & space(2) & teamb(4)
end sub
2樓:匿名使用者
1team(1) = "中國"
2team(2) = "美國"
3team(3) = "巴西"
team(4) = "古巴"
team(5) = "俄羅斯"
team(6) = "荷蘭"
team(7) = "德國"
team(8) = "西班牙"
for i = 1 to 8
x = int((9 - i) * rnd + 1) '剩餘隨機選擇
if i > 4 then
teama(i - 4) = team(x)
else
teamb(i) = team(x)
end if
for j = x to 8
if j < 8 then team(j) = team(j + 1)
next
next
text1.text = teama(1) & space(2) & teama(2) & space(2) & teama(3) & space(2) & teama(4)
text2.text = teamb(1) & space(2) & teamb(2) & space(2) & teamb(3) & space(2) & teamb(4)
end sub0
3樓:匿名使用者
private sub command1_click()
dim team(8), teama(4), teamb(4) as string, i%, j%
team(1) = "中國"
team(2) = "美國"
team(3) = "巴西"
team(4) = "古巴"
team(5) = "俄羅斯"
team(6) = "荷蘭"
team(7) = "德國"
team(8) = "西班牙"
for i = 1 to 8
x = int((9 - i) * rnd + 1) '剩餘隨機選擇
if i > 4 then
teama(i - 4) = team(x)
else
teamb(i) = team(x)
end if
for j = x to 8
if j < 8 then team(j) = team(j + 1)
next
next
text1.text = teama(1) & space(2) & teama(2) & space(2) & teama(3) & space(2) & teama(4)
text2.text = teamb(1) & space(2) & teamb(2) & space(2) & teamb(3) & space(2) & teamb(4)
end sub
用vb編寫一個比賽分組抽籤程式,把八支隊伍隨機分成a,b兩個小組,每個小組各有四支,急求啊
4樓:匿名使用者
dim team(7) as string,i%,ia%,ib%randomize
for i=0 to 7
if int(rnd*2)=0 and ia<4 thenteam(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
急求一個在excel中使用的隨機抽籤排序程式,要求抽籤前所有備抽人員在excel隨機中滾動顯示
5樓:二歲陽光
一個取巧、簡單的方法,用公式就能解決,假設有10個人1、a1:a10輸入公式=rand()
2、在b1:b10輸入公式b1=rank(a1,$a$1:$a$10),下拉到b10
3、在e1:e10輸入1-10
4、在f1:f10輸入人名
5、在c1輸入公式 c1=vlookup(b1,$e$1:$f$10,2,0),下拉到c10
6、啟動按住f9,放開停止即可,無需其他操作,如果不想讓其他人看到abef列的數字,把字型調成白色即可。
VB程序編寫,VB程式編寫
新增兩個控制元件,一個按鈕,一個label1控制元件陣列,label1 0 label1 1 private sub form load pi 3.14159265358979end sub private sub text1 change label1 0 caption sin text1.te...
用VB編寫程式,用VB編寫一個程式
樓上的,不許要引用吧 option explicit private declare function getdrivetype lib kernel32 alias getdrivetypea byval ndrive as string as long private declare funct...
怎麼編寫VB投票統計程式,怎麼編寫一個VB投票統計程式?
private sub command1 click text1.text val text1.text 1end sub private sub command2 click text2.text val text2.text 1end sub private sub command3 click...