vb编程序实现
已经完成:
Dim a(50) As Integer, b(50) As Integer, c(50) As Integer
Private Sub Command1_Click()
k = 0: j = 0
For i = 1 To 50
If a(i) >= 0 Then
j = j + 1: b(j) = a(i)
Text2.Text = Text2.Text & Format(a(i), "@@@@")
If j Mod 10 = 0 Then Text2.Text = Text2 & vbCrLf
Else
k = k + 1: c(k) = a(i)
Text3.Text = Text3.Text & Format(a(i), "@@@@")
If k Mod 10 = 0 Then Text3.Text = Text3 & vbCrLf
End If
Next i
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
For i = 1 To 50
a(i) = Int(Rnd * 19 - 9)
Text1.Text = Text1.Text & Format(a(i), "@@@@")
If i Mod 10 = 0 Then Text1.Text = Text1.Text & vbCrLf
Next i
End Sub