#A. 【深基5.习6】蛇形方阵

    Type: RemoteJudge 1000ms 256MiB

【深基5.习6】蛇形方阵

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

给出一个不大于 99 的正整数 nn,输出 n×nn\times n 的蛇形方阵。

从左上角填上 11 开始,顺时针方向依次填入数字,如同样例所示。注意每个数字有都会占用 33 个字符,前面使用空格补齐。

输入格式

输入一个正整数 nn,含义如题所述。

输出格式

输出符合题目要求的蛇形矩阵。

4
  1  2  3  4
 12 13 14  5
 11 16 15  6
 10  9  8  7

提示

数据保证,1n91 \leq n \leq 9

【Level 1 语法基础课】检验赛1

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2024-1-9 18:30
End at
2024-1-13 15:00
Duration
92.5 hour(s)
Host
Partic.
90