View Code of Problem 118

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

Double click to view unformatted code.


Back to problem 118