Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
Draw Matrix - 2
Given an nxn matrix fill the matrix in such a way that
the upper left corner is one. And that is surrounded
by zeros. And the zeros are surrounded by ones again.
This continues until the matrix size n.
Question:
Write a program that is going to fill the
matrix with ones and zeros starting from upper left
corner.
Input specification
You will be given an integer number (n) the size of
square matrix where 1 ≤ n ≤ 20.
Output specification
Show the square matrix with ones and zeros.
Sample Input
4
|
Sample Output
0 1 0 1
0 1 0 0
0 1 1 1
0 0 0 0
|
Для отправки решений необходимо выполнить вход.
|