从键盘上输入10个整数,计算这10个整数的平均值,统计并显示比平均值大的数据个数。
Private Sub Command 1_Click()
Dim a(10)i As Integer,i As Integer,sum As Integer, aver As Integer, count As Integer
(输入数据,共2分)
For I = 1 To 10
a(i)= Val(InputBox(“请输入第”& i &“个数”))
Next
(计算平均值共3分)
sum = 0
For i = I To 10
Sum=sum + a(i)
Next
aver = sum / 10
(判断并计算个数共3分 )
count = 0
For i = I To 10
If a (i) > aver Then count = count + 1
Next
Print “比平均值大的数有”; count;“个”End Sub