题型:综合题 题类:常考题 难易度:普通
浙江省高中信息技术——VB基础知识
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)
i=1
s=0
Do While < = n ‘随机投点n次
x= Rnd : y = Rnd
z = ①
If z < = 1 Then
②
End If
i=1+1
Loop
Text2. Text = ③
End Sub
① ② ③
试题篮