#include<iostream>
using namespace std;
//例题8.3 Fibonacci
int main()
{
int n;
while (cin >> n) {
if (n == 0) {
cout << 0 << endl;
continue;
}
if (n == 1) {
cout << 1 << endl;
continue;
}
int pre = 0, aft = 1;
for (int i = 0; i < n; i++) {
int temp = pre;
pre += aft;
aft = temp;
}
cout << pre << endl;
}
return 0;
}

京公网安备 11010502036488号