实现上述功能的VB程序如下,请回答下列问题:
Const k=5
Dim a(1 To k * k)As Integer
Private Sub Form_Load( )
‘生成数组a并以矩阵形式显示在列表框list1中
End Sub
Private Sub Command1_Click()
Dim b(1 To k, k * k)As Integer
Dim n As Integer
Dim row As Integer, col As Integer
Dim s As String
s=“”
n=Val(Text1. Text)
For i=1 To k * k
row=(i-1)\k+1
①
If row=n Then
b(i)=a((col-1)*k+n)
ElseIf col=n Then
②
Else
b(i)=a(i)
End If
s=s+Str(b(i))
If ③ Then
List2. AddItem s
s=“”
End If
Next i
End Sub
① ② ③