View Code of Problem 118

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

Double click to view unformatted code.


Back to problem 118