ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Linear Data Structures: Arrays > задача:


50329 - Draw Matrix-1

Гость
• Обсуждение задачи (1)

Задачи раздела

• 50300 - Matrix
• 50319 - Toll Plazas
• 50977 - Gaussian Elimination
• 50380 - Sum of the Numbers in the ...
• 50318 - Product Info
• 50326 - Matrix Operations
• 50395 - Page "Like" Averages
• 50410 - Zero Padding
• 50329 - Draw Matrix-1
• 50337 - Exam Averages
• 50334 - What is the class average?
• 50383 - Noisy Mornings
• 51129 - Hexagon
• 51097 - Sum of Borders
• 50419 - The longest bitonic sequence
• 50420 - Teachers Sightseeing
• 50344 - Profit or Loss

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Prepared by Ibrahim Mesecan. Сложность Бета

DRAW MATRIX 1

Write a program that asks for a number n and then draws n*n matrice which is completely filled with ones and zeros like this:
Sample Run 1:
n-->3 // the number we get from the input file is 3
1 1 1
1 0 1
1 1 1

Input specification
There is just one number (n) in the input file showing the size of matrix. 1 ≤ n ≤ 20.

Output specification
The outer most square will be filled with ones. Then, every inner line with zeros and ones following each other.
Give a space after every digit.
Sample Run2:
n-->5 // the number we get from the input file is 5
1 1 1 1 1
1 0 0 0 1
1 0 1 0 1
1 0 0 0 1
1 1 1 1 1

Sample Run3:
n-->6 // the number we get from the input file is 6
1 1 1 1 1 1
1 0 0 0 0 1
1 0 1 1 0 1
1 0 1 1 0 1
1 0 0 0 0 1
1 1 1 1 1 1

Для отправки решений необходимо выполнить вход.

www.contester.ru