vb编写一个程序,随机生成十个两位数保存到一维数组中,把该数组的各元素值反序
推荐于2018-04-11
展开全部
'VB6.0代码
Dim N(1 To 10) As String
Private Sub Command1_Click()
Dim i As Integer
For i = 1 To 10
N(i) = Int(Rnd * 90 + 10)
Next
Text1.Text = Join(N, " ")
End Sub
Private Sub Command2_Click()
Dim i As Integer
Dim m As String
For i = 1 To 5
m = N(i)
N(i) = N(11 - i)
N(11 - i) = m
Next
Text2.Text = Join(N, " ")
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Command1.Caption = "产生"
Command2.Caption = "反序"
Command3.Caption = "退出"
Label1.Caption = "产生数组"
Label2.Caption = "反序存放"
Text1.Text = ""
Text2.Text = ""
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询