1364: Spiral matrix
内存限制:128 MB
时间限制:1.000 S
评测方式:文本比较
命题人:
提交:135
解决:108
题目描述
So-called spiral matrix N * N, such as:
7 8 9
6 1 2
5 4 3
Matrix are an odd number of N order number. Starting from the matrix in the middle of the position, from 1 began to increase.
7 8 9
6 1 2
5 4 3
Matrix are an odd number of N order number. Starting from the matrix in the middle of the position, from 1 began to increase.
输入
Input a positive number N (0 < N < 20)
输出
Output b [n] start with “Case I:”, each element separated by Spaces. “I” is the Ist group test data.
样例输入 复制
1
2
5
样例输出 复制
Case 1:
1
Case 2:
Wrong data
Case 3:
21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13