帮我做一下下面这个vb题吧!!!!谢谢了!!!
展开全部
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
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
展开全部
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
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
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
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询