UVA 10696 - f91 Solution

#include<stdio.h>
int f91(int N)
{
    if(N <= 100)
    {
        return f91(f91(N+11));
    }

    else if(N >= 101)
    {
        return N-10;
    }
}

int main()
{
    int N, a;

    while(scanf("%d", &N))
    {
        if(N == 0)
        {
            break;
        }

        a = f91(N);

        printf("f91(%d) = %d\n", N, a);

    }

    return 0;
}


Comments