Advertisement
Tuan577

Untitled

Sep 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. int Fibonacci_1lanDeQuy(int n)
  2. {
  3. if (n == 0)
  4. return 1;
  5. else if (n == 1)
  6. return 1;
  7. else
  8. {
  9. static int n0 = 0, n1 = 1, n2;
  10. if (n > 0)
  11. {
  12. n2 = n0 + n1;
  13. n0 = n1;
  14. n1 = n2;
  15. Fibonacci_1lanDeQuy(n - 1);
  16. }
  17. if (n == 2)
  18. return n2;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement