首先,这个过程有错误:
Private Sub ys(a() As Integer, k As Integer)
Dim i As Integer, max As Integer
max = a(1, 1): k = 1
For i = 1 To 5
If max < a(i, i) Then
a(i, i) = max: k = i
End If
Next i
End Sub
改成
Private Sub ys(a() As Integer, k As Integer)
Dim i As Integer, max As Integer
max = a(1, 1): k = 1
For i = 1 To 5
If max < a(i, i) Then
max = a(i, i) : k = i
End If
Next i
End Sub