View Code of Problem 118

#include<stdio.h>
#include <string.h>
#include <math.h>
void main()
{
	int n,flag=1;
	double m;
	while(scanf("%d",&n)!=EOF)
	{
		if(n<=3)
		{
			printf("Case #%d: 5\n",flag++);

		}
		else
		{
			m=5+(n-3)*1.5+0.5;
          printf("Case #%d: %d\n",flag++,(int)m);
		}
		
	}
    
}

Double click to view unformatted code.


Back to problem 118