单击一个按钮,生成20个【0,100】之间的随机整数,显示于文本框text1中,单击第二个按钮,
3个回答
展开全部
Dim a(19) As Integer
Private Sub Command1_Click()
Text1.Text = ""
For i = 0 To 19
a(i) = Fix(Rnd * 101)
Text1.Text = Text1.Text & a(i) & " "
Next
Text1.Text = RTrim(Text1.Text)
End Sub
Private Sub Command2_Click()
temp = a(0)
For i = 1 To 19
If a(i) > temp Then
temp = a(i)
End If
Next
Text2.Text = temp
End Sub
Private Sub Command1_Click()
Text1.Text = ""
For i = 0 To 19
a(i) = Fix(Rnd * 101)
Text1.Text = Text1.Text & a(i) & " "
Next
Text1.Text = RTrim(Text1.Text)
End Sub
Private Sub Command2_Click()
temp = a(0)
For i = 1 To 19
If a(i) > temp Then
temp = a(i)
End If
Next
Text2.Text = temp
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim x As Integer
Private Sub Command1_Click()
Randomize
Dim a(20) As Integer
For i = 1 To 20
a(i) = Int(Rnd * 100)
Text1 = Text1 & " " & a(i)
If x < a(i) Then x = a(i)
Next i
End Sub
Private Sub Command2_Click()
Text2 = x
End Sub
Private Sub Command1_Click()
Randomize
Dim a(20) As Integer
For i = 1 To 20
a(i) = Int(Rnd * 100)
Text1 = Text1 & " " & a(i)
If x < a(i) Then x = a(i)
Next i
End Sub
Private Sub Command2_Click()
Text2 = x
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
vb.net乎?课本上就有啊!靠,这个你也问,懒得很啊!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询