View Code of Problem 118

#include<iostream>
using namespace std;
int main() {
	int n,k=1;
	while (cin >> n) {
		float sum = 5;
		if(n>3) {
			sum += (n - 3)*1.5;
			if (n % 2 == 0)
				sum += 0.5;
		}
		cout << "Case #" << k++ << ": "<< sum << endl;
	}
}

Double click to view unformatted code.


Back to problem 118