View Code of Problem 118

#include<bits/stdc++.h>
using namespace std;
int main(){
	float n;
	int i=1;
	while(cin>>n){
		if(n<=3){
			cout<<"Case #"<<i<<": "<<"5"<<endl;
			i++;
		}
		if(n>3){
			float fee=5+(ceil(n)-3)*1.5;
			cout<<"Case #"<<i<<": "<<ceil(fee)<<endl;
			i++;
		}
	}
} 

Double click to view unformatted code.


Back to problem 118