#K42137. Floyd's Triangle
Floyd's Triangle
Floyd's Triangle
Given a positive integer n representing the number of rows, your task is to generate Floyd's Triangle. Floyd's Triangle is a right-angled triangular array of natural numbers where the first row contains 1 number, the second row contains 2 numbers, and the n-th row contains n numbers.
The numbers are consecutive natural numbers starting from 1. For example, when n = 3, the triangle is:
1 2 3 4 5 6
If the input is non-positive (i.e. n ≤ 0), output nothing.
Note: The total number of elements in the triangle is given by the formula \(\frac{n\times (n+1)}{2}\).
inputFormat
The input consists of a single integer from standard input that indicates the number of rows to be printed in Floyd's Triangle.
Input is provided via stdin.
outputFormat
For a positive number of rows, output the Floyd's Triangle with each row on a new line and numbers separated by a single space. If the input is non-positive, no output should be produced.
Output should be written to stdout.
## sample1
1
</p>