View Code of Problem 118

#include<stdio.h>
#include<string.h>
#include<math.h>


int main(){

	int n;
	int i=0;
	while(scanf("%d",&n)!=EOF){
		i++;
		int sum=0;
		printf("Case #%d: ",i);	
		if(n<=3&&n>0)sum=5;
		if(n>3){
			if((n-3)%2==0)sum=5+1.5*(n-3);
			else sum=5.5+1.5*(n-3);
		
		}
		printf("%d\n",sum);
			
			
		
	}
	
}

Double click to view unformatted code.


Back to problem 118