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)sum=5;
		else {
			sum=5+1.5*(n-3);
		if(sum%2!=0)sum++;
		
		}
		printf("%d\n",sum);
			
			
		
	}
	
}

Double click to view unformatted code.


Back to problem 118