文件名称:dd
介绍说明--下载内容均来自于网络,请自行研究使用
打印出以下的杨辉三角形(要求打印出10行)。
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1 1
… … … … … … …
算法提示:设一个二维数组:a[11][11],则杨辉三角形有如下特点:
A、数组的第一列和对角线元素值均为1;
B、其他各元素为: a[i][j]=a[i-1][j-1]+a[i-1][j]
保存为1.cpp。
-Print out the following Triangle (required to print out 10 rows). 1,111,211,331,146,411,510 10 5 1 1 ..................... algorithm Tip: Let a two-dimensional array: a [11] [11], the Triangle has following characteristics: A, the first column of the array elements and diagonal values are 1 B, other elements: a [i] [j] = a [i-1] [j-1]+a [i- 1] [j] is saved as 1.cpp.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1 1
… … … … … … …
算法提示:设一个二维数组:a[11][11],则杨辉三角形有如下特点:
A、数组的第一列和对角线元素值均为1;
B、其他各元素为: a[i][j]=a[i-1][j-1]+a[i-1][j]
保存为1.cpp。
-Print out the following Triangle (required to print out 10 rows). 1,111,211,331,146,411,510 10 5 1 1 ..................... algorithm Tip: Let a two-dimensional array: a [11] [11], the Triangle has following characteristics: A, the first column of the array elements and diagonal values are 1 B, other elements: a [i] [j] = a [i-1] [j-1]+a [i- 1] [j] is saved as 1.cpp.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
dd\新建 Microsoft Word 文档.doc
dd