View Code of Problem 118

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

int main() {
	int n,k=0;
	double price;
	while(scanf("%d",&n)!=EOF){
		if(n<=3){
			price=5;
		}
		else{
			price=5+(n-3)*1.5;
			ceil(price);
		}
		k++;
		printf("Case #%d %.0lf\n",k,price);
	}
}

Double click to view unformatted code.


Back to problem 118