View Code of Problem 118

#include <stdio.h>
using namespace std;
int main(){
	
	float n;
	int k=1;
	while( ~scanf("%f", &n )){
		if( n<=3 ) printf("Case #%d: 5\n", k++);
		else{
			float sum = 5+1.5*(n-3);
			int a = (int)sum;
			float b = sum -a;
			if( b >0 ){
				printf("Case #%d: %d\n", k++, a+1 );
			}else{
				printf("Case #%d: %d\n", k++, a );
			}
		}
	}

	return 0;
	
}

Double click to view unformatted code.


Back to problem 118