Your task is to write a program that prints “spirals” of size , as it is shown in the examples.
The input consists of a sequence of natural numbers ended with zero.
For each , your program must print a spiral of size . Notice that in the row of the bottom and the column on the rigth there only are |’X’|s. Print a line in white after each spiral.
Although it is not essential use a matrix to solve this problem, do it for simplicity.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T11:32:33.095Z
© Jutge.org, 2006–2026.
https://jutge.org