|
|
8 роки тому | |
|---|---|---|
| .. | ||
| src | 8 роки тому | |
| tests | 8 роки тому | |
| Cargo.toml | 8 роки тому | |
| README.md | 8 роки тому | |
Run the cargo command to prepare your task3/ directory as a library
Compute Pascal’s triangle up to a given number of rows. Create the new type
PascalsTriangle and implement the methods new() and rows(). See the
tests/task3.rs for more informationen about parameters and returns of the
methods. Do not use any crates.
In Pascal’s Triangle each number is computed by adding the numbers to the right and left of the current position in the previous row.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
# ... etc