View Code of Problem 118

#include<stdio.h>
#include <math.h>
int main() {
	int n;
	int a = 1;
	while (scanf("%d", &n)!=EOF)
	{
		if (n <= 3)
		{
			printf("Case #%d: 5\n", a);
			a++;
		}
		else
		{
			int x = ceil((n - 3) * 1.5 + 5);
			printf("Case #%d: %d\n", a, x);
			a++;
		}

	}
	
}

Double click to view unformatted code.


Back to problem 118