View Code of Problem 118

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k=1,sum;
	while(cin>>n&&n>0)
	{
		if(n<=3)
		{
		sum=5;
		}
		else
		{
		sum=ceil((5+(n-3)*1.5));
		}
		cout<<"Case #"<<k++<<":"<<" "<<sum<<endl;
	}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 118