Private Sub Command1_Click()
Dim n As Integer '裁判人数
Dim max As Integer, min As Integer, sum As Integer
Dim AveScore As Single '存储最终得分
n = Val(Text1.Text): sum = 0
If n <= 2 Then MsgBox ("输入数据要大于2,请重新输入!")
If n > 2 Then
List1.Clear
Randomize
score = Int(Rnd() * 31) + 70
List1.AddItem Str(score)
max = score
min = score
For i = 2 To n
score = Int(Rnd() * 31) + 70
List1.AddItem Str(score)
If score > max Then max = score
If score < min Then min = score
sum = sum + score
Next i
AveScore =
Text2.Text = Str(AveScore)
End If
End Sub