View Code of Problem 69

#include <stdio.h>

int fx(int x)
{
    if(x < 1)
        return x;
    if(x < 10 && x >= 1)
        return 2 * x - 1;
    else
        return 3 * x - 11;
}

int main(void)
{
    int x;
    while(scanf("%d",&x) != EOF)
    {
        printf("%d\n",fx(x));
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 69