1070: 螺旋矩阵
Memory Limit:128 MB
Time Limit:0.000 S
Judge Style:Text Compare
Creator:
Submit:3
Solved:2
Description
打印一个n*n的数字螺旋方阵。这个数字方阵的特点是:以左上角1开始向下,数字以外圈向里按自然数顺序转圈递增,一直到中心位置的n*n为止。例如n  =3:
1    8    7
2    9    6
3    4    5
Input
第一行,一个整数n(< =20)。
Output
共n行,每行n个整数,即n阶螺旋矩阵。
Sample Input Copy
3
Sample Output Copy
1 8 7
2 9 6
3 4 5