12795: 第8章:数组 8.12 杨辉三角形
Memory Limit:2 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:3
Solved:0
Description
用函数编程计算并输出如图1-5所示的杨辉三角形。
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
···
图1-5 杨辉三角形
Input
1个数n(n<20)。表示杨辉三角有几行。
Output
输出n行杨辉三角。两数之间用空格隔开。
Sample Input Copy
7
Sample Output Copy
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1