mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2025-09-11 23:11:21 +02:00
599 B
599 B
print-pyramid
Created by @Divlo on 21 September 2021.
Instructions
Display a pyramid of stars (*) whose height is given and in the right order (normal or reverse).
Input
- Line 1: The string :
normalorreverseto determine how to show the pyramid. - Line 2: The integer : height of the pyramid.
Examples
See the test folder for examples of input/output.
Example 1
Input
normal
3
Output
*
***
*****
Example 2
Input
reverse
3
Output
*****
***
*