View Code of Problem 118

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

}

Double click to view unformatted code.


Back to problem 118