1个回答
展开全部
Option Explicit
Dim i As Integer
Dim a As Integer
Dim sum As Integer
Dim max As Integer
Dim min As Integer
Dim j As Integer
Private Sub Command1_Click()
Label1.Caption = "产生随机数如上图"
Label2.Visible = True
Label2.Caption = "其总和为:"
Label3.Visible = True
Label3.Caption = "最大值为:"
Label4.Visible = True
Label4.Caption = "最小值为:"
Print
max = 1
min = 100
For i = 1 To 100
Randomize
a = Int(Rnd * 100) + 1
Print Format(a, "@@@@@"); '只需要在这里改一下
If i Mod 10 = 0 Then Print
sum = sum + a
Text1.Text = sum
If a > max Then max = a
Text2.Text = max
If a < min Then min = a
Text3.Text = min
Next i
End Sub
Dim i As Integer
Dim a As Integer
Dim sum As Integer
Dim max As Integer
Dim min As Integer
Dim j As Integer
Private Sub Command1_Click()
Label1.Caption = "产生随机数如上图"
Label2.Visible = True
Label2.Caption = "其总和为:"
Label3.Visible = True
Label3.Caption = "最大值为:"
Label4.Visible = True
Label4.Caption = "最小值为:"
max = 1
min = 100
For i = 1 To 100
Randomize
a = Int(Rnd * 100) + 1
Print Format(a, "@@@@@"); '只需要在这里改一下
If i Mod 10 = 0 Then Print
sum = sum + a
Text1.Text = sum
If a > max Then max = a
Text2.Text = max
If a < min Then min = a
Text3.Text = min
Next i
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询