#C659. Centered Equilateral Triangle Pattern
Centered Equilateral Triangle Pattern
Centered Equilateral Triangle Pattern
Given an integer ( n ), print a centered equilateral triangle of height ( n ) using asterisks ('*'). Each row in the triangle contains an odd number of asterisks and is centered relative to the widest row in the triangle. The pattern should be printed on the console with each row on a new line.
For example, if the input is 3
, the output must be: *
**
inputFormat
The input consists of a single integer ( n ) where ( 1 \le n \le 100 ). The integer is provided via standard input.
outputFormat
Output the equilateral triangle pattern of height ( n ) using asterisks. Each row should be centered with respect to the widest row, and there should be no extra spaces at the end of any line. The output should be printed to standard output.## sample
1
*
</p>