#K5451. Pascal's Triangle Generator
Pascal's Triangle Generator
Pascal's Triangle Generator
Given a non-negative integer \(n\), generate a string representation of the first \(n+1\) rows of Pascal's Triangle. Each row is represented as numbers separated by a single space. The rows are separated by newline characters (\n).
For example, if \(n=3\), then the triangle should be:
1 1 1 1 2 1 1 3 3 1
Your program should read the integer \(n\) from standard input and output the triangle to standard output.
inputFormat
The input consists of a single non-negative integer \(n\) on a single line. \(n\) indicates that the first \(n+1\) rows of Pascal's Triangle should be printed.
outputFormat
Output the first \(n+1\) rows of Pascal's Triangle, with each row printed on a new line. Each number in a row should be separated by a single space.
## sample0
1