![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=1738858658-amUxdlmCBMGIAxTDG36w6zN36zFSgzif-0-9e61531bc63c17a0f0ce4ea9cfe8351f)
![](https://epubservercos.yuewen.com/83F064/19470387108850106/epubprivate/OEBPS/Images/2014f2ea-02e6-4ce2-bde3-838eda88afbe.png?sign=1738858658-nnuiVNxcs8LfUzAXReiyX3eMFdbCKPGC-0-021b3f29a26a93eb27f3f9a0fd78a235)