View Code of Problem 118

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

#define MIN(x, y) ((x) < (y) ? (x) : (y))

int main() {
	int Case = 0;
	float money = 5;
	
	long n;
	
	while(~scanf("%ld", &n)) {
		Case ++; 
		if(n > 3) {
			money += ((n - 3) * 1.5);
		} 
		printf("Case #%d: %.lf\n", Case, money);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 118