mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-26 17:12:06 +00:00
21 lines
269 B
C++
21 lines
269 B
C++
|
#include <iostream>
|
||
|
|
||
|
using std::cin;
|
||
|
using std::cout;
|
||
|
const char endl = '\n';
|
||
|
|
||
|
int f(int x) {
|
||
|
return x == 1 || x == 2 ? 1 : f(x - 1) + f(x - 2);
|
||
|
}
|
||
|
|
||
|
int n;
|
||
|
|
||
|
int main() {
|
||
|
std::ios::sync_with_stdio(false);
|
||
|
|
||
|
cin >> n;
|
||
|
cout << f(n) << endl;
|
||
|
|
||
|
return 0;
|
||
|
}
|