407139: GYM102697 110 Pyramid
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
110. Pyramidtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
Much like the previous question, you are going to be making some ASCII art. In this question your job is to make a pyramid given a number that represents the base of the pyramid. Each layer going up from the base should be 2 less in length than the previous layer. The pyramid is complete when the length of the top layer is either 1 or 2.
InputA single number representing the base of the pyramid.
OutputPrint the pyramid using "X"'s
ExampleInput7Output
X XXX XXXXX XXXXXXXNote
Don't forget to add spacing on the left side so that it doesn't end up looking like a right triangle.