#C11467. Right-Angled Number Triangle
Right-Angled Number Triangle
Right-Angled Number Triangle
Given an integer n, print a right-angled triangle of numbers with n rows. In the i-th row, print the sequence of numbers from 1 to i separated by a single space.
The task is to generate a triangle pattern where each row gradually increases the sequence of numbers. Use the following formula for the numbers in the i-th row:
\( \text{Row}_i = 1\, 2\, \dots \,, i \)
inputFormat
The input consists of a single integer n provided via standard input (stdin
), where n represents the number of rows in the triangle. You can assume that n is a positive integer.
outputFormat
The output should print the right-angled triangle pattern. Each row of the triangle should contain consecutive numbers starting from 1 up to the row number, with each number separated by a single space. The result is printed to standard output (stdout
).
1
1
</p>