25. Pascal's Triangle
EasyMathArray
Print the first n rows of Pascal's triangle, one row per line.
Input format
A single integer n.
Output format
n lines of space-separated numbers.
Example 1
Input
5
Output
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
Example 2
Input
1
Output
1
Constraints
1 ≤ n ≤ 30
Read input from standard input and print the answer to standard output. Your code is judged against 4 test cases, most of them hidden.
Loading the MyLoginn IDE…