Private Sub Command1_Click() Dim a(5, 5), m, n For i = 1 To 5 m = 7 - i n = -1 For j = 1 To 5 m = m + n If m = 0 Then n = -n: m = 2 a(j, i) = m Next j, i For i = 1 To 5 For j = 1 To 5 Print a(i, j); Next j Print Next i End Sub本回答被提问者采纳
第2个回答 2013-03-08
Dim i As Integer Dim j As Integer Dim k As Integer Dim n As Integer Dim d(1 To 5, 1 To 5) As Integer For i = 1 To 5 n = 6 - i k = 0 Do While n > 0 k = k + 1 d(i, k) = n n = n - 1 Loop n = 1 Do While k <= 5 d(i, k) = n n = n + 1 k = k + 1 Loop Next i For i = 1 To 5 For j = 1 To 5 Print d(i, j); Next j Print Next i本回答被网友采纳