vb编程 随机生成100个0-99的随机数,并以10*10的样式对齐显示,然后计算每行数字的平均数随机生成100个0-99的随机数,并以10*10的样式对齐显示,然后计算每行数字的平均数,并统计0—9,10-19...对应区
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/17 00:32:26
vb编程 随机生成100个0-99的随机数,并以10*10的样式对齐显示,然后计算每行数字的平均数随机生成100个0-99的随机数,并以10*10的样式对齐显示,然后计算每行数字的平均数,并统计0—9,10-19...对应区
vb编程 随机生成100个0-99的随机数,并以10*10的样式对齐显示,然后计算每行数字的平均数
随机生成100个0-99的随机数,并以10*10的样式对齐显示,
然后计算每行数字的平均数,并统计0—9,10-19...对应区间数字的个数.
vb编程 随机生成100个0-99的随机数,并以10*10的样式对齐显示,然后计算每行数字的平均数随机生成100个0-99的随机数,并以10*10的样式对齐显示,然后计算每行数字的平均数,并统计0—9,10-19...对应区
先建一个大一点的label1框,然后...
Dim a As Integer
Dim b As String
Dim c As Integer
Dim d As String
Dim e As Integer
Dim f As Integer
Dim g As Integer
Dim h As Integer
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim l As Integer
Dim m As Integer
Dim n As Integer
Private Sub Form_Load()
For x = 1 To 10
For y = 1 To 10
a = Int(Rnd * 100)
Select Case a
Case Is < 10:
e = e + 1
Case Is < 20:
f = f + 1
Case a < 30:
g = g + 1
Case Is < 40:
h = h + 1
Case Is < 50:
i = i + 1
Case Is < 60:
j = j + 1
Case Is < 70:
k = k + 1
Case Is < 80:
l = l + 1
Case Is < 90:
m = m + 1
Case Is < 100:
n = n + 1
End Select
b = b & a & "、"
c = c + a
Next
c = c / 10
b = b & "avg:" & c & vbCrLf
c = 0
Next
Label1.Caption = b & "[0~9:" & e & "]、[10~19:" & f & "]、[20~29:" & g & "]、[30~39:" & h & "]、[40~49:" & i & "]、[50~59:" & j & "]、[60~69:" & k & "]、[70~79:" & l & "]、[80~89:" & m & "]、[90~100:" & n & "]"
End Sub