View Code of Problem 118

#include<iostream>
#include<math.h>
using namespace std;
int main(){
	int n,i=1;
	double s,p;
	while(cin>>s){
		if(s<=3){
			p=5;	
		}
		else if(s>3){
			p=ceil((s-3)*1.5+5);
		}
		cout<<"Case #"<<i++<<": "<<p<<endl;
	}
	
	return 0;
}

Double click to view unformatted code.


Back to problem 118