View Code of Problem 118

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

Double click to view unformatted code.


Back to problem 118