fib.cpp 99 B

12345678
  1. extern "C" int fib(int n) {
  2. if (n <= 2) {
  3. return 1;
  4. }
  5. return fib(n - 1) + fib(n -2);
  6. }