View Code of Problem 118

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

Double click to view unformatted code.


Back to problem 118