Dim a(1 to 10), i%, t%, s%, avg#
For i = 1 To 10
a(i) = Int((Rnd * 71 + 30))
s = s + a(i)
avg = s / 10
Print a(i):
Next i
For i = 1 To 9
If a(i) > a(i + 1) Then t = a(i + 1): a(i + 1) = a(i): a(i) = t: Min = i + 1
ElseIf a(i) < a(i + 1) Then
t = a(i + 1): a(i + 1) = a(i): a(i) = t: Max = i
End If
Next i
Print "Min="; a(Min); " Max="; a(Max); s, "Avg = "; avg
End Sub
运行后怎么会出现,不是已经用了if else吗?