GoralWMoro

Liczba Stirlinga

Nov 27th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2. int stirling(int n, int k){
  3. if(k==n){
  4. return 1;
  5. }else if(k==0){
  6. return 0;
  7. }else if(k > n){
  8. return 0;
  9. }
  10. return (n-1)*stirling(n-1, k)+stirling(n-1, k-1);
  11. }
  12.  
  13. int main() {
  14. printf("Liczba stirlinga %d", stirling(0,2));
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment