上次给出了C语言编写的正态分布随机数程序,这次是VB的,转载请注明出处
Private Sub Command1_Click()
Dim i, n As Integer
Dim mu, sigma As Double
mu = Text1.Text
sigma = Text2.Text
n = Text3.Text
Open "data.txt" For Output As #1
For i = 0 To n
If i = n Then Exit For
Text4.Text = Text4.Text & Str(sta(mu, sigma)) & Chr(9)
Write #1, sta(mu, sigma)
Next
Close #1
End Sub
End Function
联系客服