View Code of Problem 118

#include<stdio.h>
int main()

{
    int s;
    int i=1;
    int sum;
    while(scanf("%d",&s)!=EOF)
    {
        printf("Case #%d:",i);
        i++;
        if(s>0&&s<=3) printf("5\n");
        else if(s>3)
        {
            if(s%2==0) sum=5+(s-3)*1.5+1;
            else sum=5+(s-3)*1.5;
             printf("%d\n",sum);
        }


    }

}

Double click to view unformatted code.


Back to problem 118