#include<stdio.h>
unsigned long long int Fib (unsigned long long int n);

int main()
{
    unsigned long long int n, i, x;
    printf("Input n:");
    scanf("%d", &n);
    for (i = 1; i <= n; i++)
    {
        x = Fib (i);
        printf("Fib(%d) = %lld\n", i, x);
    }

    return 0;
}

unsigned long long int Fib (unsigned long long int n)
{
    if (n == 0)
    {
        return 0;
    }
    else if (n == 1 || n == 2)
    {
        return 1;
    }
    else
    {
        unsigned long long int i, a1 = 1, a2 = 1;
        for (i = 3;i <= n; i++)
        {
            a2 = a1 + a2;
            a1 = a2 - a1;
        }
        return a2;
    }
}
