vb题。以下程序用随机数函数模拟是筛子,统计掷1000次出现各点的次数,请完善之:

2025-01-03 02:28:26
推荐回答(1个)
回答1:

private sub form_click()
dim s(1 to 6) as integer
dim i as integer, n as integer
randomize timer
for i = 1 to 1000
n =Rnd[6]
s(n)=s(n)+1
next i
for i =1 to 6
print i;"点出现";s(i);"次。"
next i
end sub