View Code of Problem 118

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

int main()
{
    int n,k = 1;

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

Double click to view unformatted code.


Back to problem 118