![The Modern C# Challenge](https://wfqqreader-1252317822.image.myqcloud.com/cover/300/36699300/b_36699300.jpg)
上QQ阅读APP看书,第一时间看更新
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.
![](https://epubservercos.yuewen.com/83F064/19470387108850106/epubprivate/OEBPS/Images/de648522-cb52-459c-975a-1f317195ac23.png?sign=1739325630-zxWvpmwj28uLu1ClTACWqootkDqkuG8o-0-27d5a721982d52bbef1845d8e1f9cacb)
![](https://epubservercos.yuewen.com/83F064/19470387108850106/epubprivate/OEBPS/Images/2014f2ea-02e6-4ce2-bde3-838eda88afbe.png?sign=1739325630-slIAAhW8idsGaBEkrLD4qYdeqllgRo3Q-0-57edfffa7bacbbab11abee19a28568eb)