View Code of Problem 118

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

Double click to view unformatted code.


Back to problem 118