58. Floyd's Triangle

Acceptance — 0 accepted 0 submissions

Easy
Nested LoopsPatterns
No companies listed
Floyd's triangle fills rows with consecutive numbers: row 1 has 1 number, row 2 has 2 numbers, and the counting never restarts.

1
2 3
4 5 6
…
Given N, print the first N rows.

Input Format
A single integer N.

Output Format
Print N lines. Line i has i consecutive numbers separated by single spaces.

Constraints
• 1 ≤ N ≤ 30

Example 1

Input
4
Output
1
2 3
4 5 6
7 8 9 10

Explanation Numbers 1 to 10 filled row by row.

Example 2

Input
1
Output
1

Explanation Only 1.

Example 3

Input
3
Output
1
2 3
4 5 6

Explanation 1 / 2 3 / 4 5 6.

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
1 2 3 4 5 6 7 8 9 10
No results yet
Run your code to test it against the sample cases.
Problem List