View Code of Problem 118

#include<stdio.h>
#include<math.h>
#include<string.h>

int main()
{
    int n;

    while(scanf("%d",&n) != EOF)
    {
        if(n <= 3)
            printf("5\n");
        else
        {
            float sum = (float)5+(n-3)*1.5;
            printf("%d\n",ceil(sum));
        }
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 118