帮我做一下下面这个vb题吧!!!!谢谢了!!!

随机产生10个整数成绩[60,100]存入一维数组,并求最高分、最低分和平均值... 随机产生10个整数成绩[60,100]存入一维数组,并求最高分、最低分和平均值 展开
 我来答
百度网友bdb9803
2011-06-10 · TA获得超过1.1万个赞
知道大有可为答主
回答量:1.1万
采纳率:53%
帮助的人:1亿
展开全部
Dim a(1 To 10) As Integer

Private Sub Command1_Click()
Dim i As Integer
For i = 1 To 10
a(i) = Int(Rnd * 41) + 60
text1 = text1 & a(i) & " "
Next
End Sub

Private Sub Command2_Click()
Dim i, max, min, avg As Integer
max = a(1)
min = a(1)
For i = 2 To 10
If a(i) > max Then max = a(i)
If a(i) < min Then min = a(i)
avg = avg + a(i)
Next
text2 = max
text3 = min
text4 = avg / 10
End Sub
chiefzjh
2011-06-10 · TA获得超过9088个赞
知道大有可为答主
回答量:7013
采纳率:37%
帮助的人:2390万
展开全部
Dim mArr%(1 To 10)
Private Sub Command1_Click()
Dim i%
Text1.Text = ""
For i = 1 To 10
Randomize
mArr(i) = Int(Rnd * 41) + 60
Text1.Text = Text1.Text & mArr(i) & " "
Next
End Sub

Private Sub Command2_Click()
Dim Max%, Min%, Sum%
Min = 100
For i = 1 To 10
If mArr(i) > Max Then Max = mArr(i)
If mArr(i) < Min Then Min = mArr(i)
Sum = Sum + mArr(i)
Next i
Text2.Text = Max
Text3.Text = Min
Text4.Text = Sum / 10
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
mahu98
2011-06-10 · TA获得超过147个赞
知道小有建树答主
回答量:202
采纳率:0%
帮助的人:55.8万
展开全部
Dim A(10) As Integer

Private Sub Command1_Click()
Me.Text1 = ""
Me.Text2 = ""
Me.Text3 = ""
Me.Text4 = ""
Randomize
For i = 1 To 10
A(i) = Int(Rnd * 41 + 60)
Me.Text1 = Me.Text1 & A(i) & " "
Next
End Sub

Private Sub Command2_Click()
Sum = A(1): Ma = A(1): Mi = A(1)
For i = 2 To 10
Sum = Sum + A(i)
If A(i) > Ma Then Ma = A(i)
If A(i) < Mi Then Mi = A(i)
Next
Me.Text2 = Ma
Me.Text3 = Mi
Me.Text4 = Sum / 10
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式