View Code of Problem 118

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

Double click to view unformatted code.


Back to problem 118