P21656 [GeeksforGeeks] Triangle pattern 1662286302
普及-
题目描述

Ram is very fond of patterns. Once, his teacher gave him a pattern to solve. He gave Ram an integer n and asked him to build a pattern.
Help Ram build a pattern.

Example 1:
Input: 5
Output:
E
E D
E D C
E D C B
E D C B A

Example 2:
Input: 3
Output:
C
C B
C B A
Your Task:
You don't need to input anything. Complete the function printTriangle() which takes an integer n as the input parameter and print the pattern.
Constraints:
1<= N <= 20

输入格式

见题面

输出格式

见题面

样例输入
5
样例输出
E E D E D C E D C B E D C B A