#P1402. 【例63.1】 蛇形填数

    ID: 403 传统题 1000ms 64MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>http://bas.ssoier.cn:8086/problem_show.php?pid=3365数的存储与组织

【例63.1】 蛇形填数

Description

在$n×n$方阵里填入$1$,$2$,$3$,... ,$n × n$,要求填成蛇形。例如$n=4$时方阵为:
10 11 12 1
9 16 13 2
8 15 14 3
7 6 5 4

其中,$n\le 20$。

Input Format

输入$n$。

Output Format

输出题述方阵。$n$行,每行各数之间用一个空格隔开。
4
10 11 12 1
9 16 13 2
8 15 14 3
7 6 5 4

Source

http://bas.ssoier.cn:8086/problem_show.php?pid=3365 数的存储与组织