![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=1739385458-dWJ6mqp7HMaApejmEw1YARdn9OU624Xm-0-7af26c992168e5e340a686a7a8d8cc2e)
![](https://epubservercos.yuewen.com/83F064/19470387108850106/epubprivate/OEBPS/Images/2014f2ea-02e6-4ce2-bde3-838eda88afbe.png?sign=1739385458-kf1j0cDix3vt1MEuoN3HpTKrw9Mk0v8e-0-59038bfec422be53b774a3bb7b2407ad)