Advertisement
Guest User

Implemetacja w Python

a guest
Jan 20th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. def wyznaczLiczbeUporzadkowanychK(k,n):
  2. if k==1:
  3. return 1
  4. else : suma = 0
  5. for l in range(k−1,n):
  6. suma +=wyznaczLiczbeUporzadkowanychK(k−1,l )
  7. return suma;
  8. print ( ’Liczba uporzadkowanych czworek spelniajacych rownanie x1+x2+x3+x4=51: ’)
  9. print (wyznaczLiczbeUporzadkowanychK(4 ,51))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement