void big_print(struct big* b) { if (b->q == NULL) { printf("%d", b->x); return; } big_print(b->q); printf("%09d", b->x); }
int main() { big f[5001]; int m = 2, n; memset(f, 0, sizeof(f)); f[1].v[116] = 1; while (scanf("%d", &n) == 1) { for (; m <= n; ++m) big_add(&f[m - 2], &f[m - 1], &f[m]); printf("The Fibonacci number for %d is ", n); big_print(&f[n]); putchar('\n'); } return 0; }
void big_println(struct big* b) { big_print(b); printf("\n"); }