n = Val(InputBox("请输入n")) k = 2 * n - 1 ReDim a(1 To k, 1 To k) For j = 1 To k For i = 1 To k If Abs(i - n) + 1 >= Abs(j - n) + 1 Then a(i, j) = Abs(i - n) + 1 Else a(i, j) = Abs(j - n) + 1 End If Print a(i, j); Next Print Next
n = Val(InputBox("请输入n")) ReDim a(1 - n To n - 1, 1 - n To n - 1) For j = 1 - n To n - 1 For i = 1 - n To n - 1 If Abs(i) >= Abs(j) Then a(i, j) = Abs(i) + 1 Else a(i, j) = Abs(j) + 1 End If Print a(i, j); Next Print Next