官术网_书友最值得收藏!

7. Pascal's triangle

Pascal's triangle is a triangle of numbers (you probably guessed that from its name) where each row begins and ends with 1 and every other value is the sum of the two numbers above it. The following diagram shows the first six rows of Pascal's triangle:

Write a program that displays Pascal's triangle as simple text. For a bigger challenge, display the values graphically centered over each other, as shown in the preceding figure.

The values in Pascal's triangle are binomial coefficients, where the K th value in row N is . Here the rows and entries are numbered starting at zero. For example, the third entry in the fifth row has the value =6.
主站蜘蛛池模板: 左云县| 蓝田县| 吉首市| 景泰县| 平远县| 武强县| 山东| 宜君县| 建宁县| 拜城县| 廊坊市| 木兰县| 巴东县| 苍南县| 伽师县| 海阳市| 九江县| 昆山市| 鄂托克前旗| 木里| 扶沟县| 南丹县| 福建省| 新邵县| 建水县| 临汾市| 陆良县| 外汇| 五指山市| 隆回县| 公主岭市| 石城县| 丽水市| 麻阳| 盱眙县| 张掖市| 临沧市| 镶黄旗| 榆社县| 左权县| 鹰潭市|