View Code of Problem 118

#include<stdio.h>
#include<math.h>
int main(){
	float n;
	float x;
	int m=1;
	while(scanf("%f",&n)!=EOF){
		if(n>0&&n<pow(10,6)){
			if(n<=3){
				x=5;
			}else if(n>3){
				x=5+(n-3)*1.5;
			}
		}
		int y=ceil(x);
		printf("Case #%d: %d\n",m,y);
		m++;
	}
}

Double click to view unformatted code.


Back to problem 118