Write a program that prints a triangle-like pattern according to the user input, which stands for the number of layers.