View Code of Problem 118

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

int main()
{
    int n,k = 1;
    while(scanf("%d",&n) != EOF)
    {
        if(n <= 3)
            printf("Case #%d: 5\n",k++);
        else
        {
            double f = (double)5 + 1.5*(n-3);
            printf("Case #%d: %.0f\n",k++,ceil(f));
        }
    }
}

Double click to view unformatted code.


Back to problem 118