做一个程序,可以在1至100这100个数字里边,能随机抽取1个数字出来。哪位是学计算机的,帮忙编个程序
发布网友
发布时间:2023-03-09 18:05
我来回答
共1个回答
热心网友
时间:2023-10-11 16:54
Dim bStop As Boolean
Dim n(1 To 100), i, j, q
Private Sub Command1_Click()
Command1.Visible = False
Randomize Timer
While j < 10
q = Int(Rnd(1) * 100 + 1)
Label1.Caption = q: DoEvents
If n(q) = 0 And bStop = True Then
Print q
n(q) = 1
j = j + 1
bStop = False
End If
Wend
End Sub
Private Sub Command2_Click()
bStop = True
End Sub
Private Sub Form_Load()
For i = 1 To 100
n(i) = 0
Next
j = 0
bStop = False
End Sub追问这是用什么编的程序,C语言会吗
追答这是vb语言