- 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.

