Files
ARPZ_s1_pr4/alg_4_2.cpp

17 lines
216 B
C++

#include <iostream>
using namespace std;
int fib(int n)
{
if (n == 0) { return 1; }
if (n == 1) { return 1; }
return fib(n - 1) + fib(n - 2);
}
int main()
{
int n; cin >> n;
cout << fib(n);
}