Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int RecFun(int n)
- {
- if(n==0)
- return 0;
- if(n==1)
- return 1;
- else
- return (RecFun(n-2)+RecFun(n-1));
- }
- int main(int n)
- {
- int wynik;
- printf("podaj n\n");
- scanf("%d",&n);
- wynik = RecFun(n);
- printf("wynik: %d",wynik);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement