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

  • The Modern C# Challenge
  • Rod Stephens
  • 117字
  • 2021-08-13 15:23:52

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.
主站蜘蛛池模板: 和静县| 会泽县| 宜兰市| 土默特右旗| 肇庆市| 东宁县| 吉安市| 波密县| 淮滨县| 和龙市| 海宁市| 焦作市| 罗定市| 永清县| 陕西省| 文安县| 抚远县| 凤庆县| 玛沁县| 彭山县| 咸丰县| 兴义市| 尚志市| 阳山县| 库伦旗| 仁化县| 达州市| 田东县| 阿瓦提县| 平江县| 湖南省| 达州市| 田东县| 六枝特区| 彰化市| 陵川县| 平江县| 嵊泗县| 兴安盟| 湄潭县| 宜宾县|