You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
249 B

#include <bits/stdc++.h>
using namespace std;
int f(int n) {
if (n == 1) return 1;
if (n == 2) return 2;
return dp(n - 1) + dp(n - 2);
}
int main() {
int N;
cin >> N;
cout << dp(N) << endl;
return 0;
}