精选优质文档-倾情为你奉上随机数统计程序代码 求最大值最小值平均值 Private Sub Command1_Click()Dim ls As IntegerRandomizes_max = 0s_min = 100For i = 1 To 4 For j = 1 To 5 ls = Round(Rnd * 100, 0) + 1 Sum = Sum + ls Text1.Text = Text1.Text Str(ls) If s_max ls Then s_min = ls Next j Text1.Text = Text1.Text vbCrLfNext i s_aver = Round(Sum / 20, 0)Text2.Text = Text2.Text 最大的数是: Str(s_max) & vbCrLfText2.Text = Text2.Text & 最小的数是: & Str(s_min) & vb