#include #include #include #include using namespace std; int a[210][1000]; int len[210]; void sol(int x, int c[], int b[]) { int l = max(len[x-1], len[x-2]); int j = 0; for(int i = 0; i <= l; i++) { a[x][i] = c[i] + b[i] + j; if(a[x][i] > 9) { j = 1; a[x][i] %= 10; } else j = 0; //printf("%d ", a[x][i]); } while(!a[x][l] && l > 0) l--; l++; len[x] = l; } int main(int argc, char const *argv[]) { memset(a, 0, sizeof(a)); memset(len, 0, sizeof(len)); len[1] = 1; a[1][0] = 1; len[2] = 1; a[2][0] = 2; for(int i = 3; i <= 200; i++) sol(i, a[i-1], a[i-2]); int n; while(~scanf("%d", &n)) { // printf("%d\n", n); for(int i = len[n]-1; i >= 0; i--) printf("%d", a[n][i]); printf("\n"); } return 0; }