View Code of Problem 118

#include<stdio.h>
#include<math.h>
int main()
{
    int n,m,i=0;
    while(scanf("%d",&n)!=EOF)
    {
        i++;
        if(n<=3)
            m=5;
        else
        {
            if(n%2==0)
                m=5+(n-3)*1.5+0.5;
            else
                m=5+(n-3)*1.5;
        }
        printf("Case #%d: %d\n",i,m);
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 118