View Code of Problem 118

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

Double click to view unformatted code.


Back to problem 118