Const MAXNUM = 100
Dim i As Integer, n As Integer
Dim a(1 To MAXNUM ^ 2) As Integer
Private Sub Command1_Click()
Dim line As String
n = Val(Text1.Text)
line = ""
List1.Clear
Randomize
For i = 1 To n ^ 2
a(i) = ①
If i > 1 And i Mod n = 1 Then
List1.AddItem line
line = Str(a(i))
Else
line = ②
End If
Next i
List1.AddItem line
End Sub
Private Sub Command2_Click()
Label1.Caption = ""
For i = 1 to ③
Label1.Caption = Label1.Caption & Str(a(i + (i - 1) * n))
Next i
End Sub
① ② ③