[求助]求一数组程序
问题:随机产生20个学生的计算机课程的成绩,并显示。统计各分数段人数,即0~59、60~69、70~79、80~89、90~100,并显示结果。用数组来解决!
[此贴子已经被作者于2007-6-25 21:31:15编辑过]
Private Sub Command1_Click()
Dim a(1 To 25)
For i = 1 To 20
a(i) = Int(Rnd * 100)
Select Case a(i)
Case 0 To 59
a(21) = a(21) + 1
Case 60 To 69
a(22) = a(22) + 1
Case 70 To 79
a(23) = a(23) + 1
Case 80 To 89
a(24) = a(24) + 1
Case 90 To 100
a(25) = a(25) + 1
End Select
Print a(i);
Next i
Print ""
Print " 0-59:" & a(21); " 60-69:" & a(22); " 70-79:"; a(23); " 80-89:"; a(24); " 90-100" & a(25)
End Sub
我好像感觉在害你...
以后专心听课,别怪没人帮助你...