Write a program that at a given N the Pascal's triangle outputs. Examples: n = 5 a n 1 1 1 2 1 1 3 3 1
- 1 4 6 4 1 1 5 10 10
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
1 5 10 10 5 1 1 6
15 20 15 6 1 1 7
21 35 35 21 7 1 1 8 28 56
70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
The program is formatted the triangle beautiful characters to the console.
Levyyour surname shall be (in the same names you please 2 x
Name the project
2
x
-
name
-python-pascal
, with
x
"a" for 2AHIF and "c" for 2CHIF and
name
-
name-first name
-python-pascal thereof). The program itself is called pascal.py . generating you with your program, the triangles with n = 1 to n = 10 in files named dreieck01.txt to dreieck10.txt . Take these files to the project. Check in the project and the CVS "commit" your final version. intended for advanced The "charge" of the polynomial (a + b) n
and spend. ZB (a + b) 2 = a 2 + 2ab + b 2 or (a + b) = a 5
5 + 5a 4
b + 10a 3 b
2 10a + b 2 3 4 5ab + + b 5. eg n = 4 4 4 3 2 2 3 4 (a + b) = a + b 4a + b 6a + 4ab + b
0 comments:
Post a Comment