17 lines
249 B
C++
17 lines
249 B
C++
|
|
#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;
|
||
|
|
}
|