test/fibo.cpp

10 lines
155 B
C++
Raw Normal View History

2024-11-06 06:57:27 +00:00
#include <bits/stdc++.h>
int fibo(int n) {
if (n <= 1) return n;
return fibo(n - 1) + fibo(n - 2);
}
int main() {
cout << fibo(5) << endl;
}