#C7926. Print Isosceles Alphabet Triangle
Print Isosceles Alphabet Triangle
Print Isosceles Alphabet Triangle
Given a positive integer \(n\) (\(1 \le n \le 26\)), print an isosceles triangle consisting of the first \(n\) uppercase English letters. The first row contains the letter 'A', the second row contains two 'B's separated by a single space, and so on. Each row must be centered within a fixed width of \(2n-1\) characters.
Example 1:
Input: 4</p>Output: A
B B
C C C D D D D
Example 2:
Input: 1</p>Output: A
Make sure your solution reads input from stdin
and outputs the result to stdout
.
inputFormat
The input is a single integer \(n\) which represents the number of rows in the triangle. It is guaranteed that \(1 \le n \le 26\).
outputFormat
The output should be an isosceles triangle of alphabets with \(n\) rows. Each row should have exactly \(2n-1\) characters (including spaces) so that the letters are centered.
## sample4
A
B B
C C C
D D D D
</p>