题型:综合题 题类:常考题 难易度:普通
【bj】高中信息技术综合库——枚举算法2
Private Sub Command1_Click()
Randomize '随机数初始化
Dim i As Long, n As Long, s As Long
Dim x As Double, y As Double, z As Double
n = Val(Text1.Text)
①
s = 0
Do While i <= n '随机投点n次
x = Rnd: y = Rnd
z = ②
If z <= 1 Then
s = s + 1
End If
i = i + 1
Loop
Text2.Text = ③
试题篮