Monday, February 22, 2016

UVa 11636 - Hello World!

// UVa 11636 - Hello World!

#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;

int main() {
	int n, t = 0;
	cin >> n;
	while (n >= 0) {
		t++;
		double sol = ceil(log(n) / log(2));
		printf("Case %d: %.0f\n", t, sol);
		cin >> n;
	}
	return 0;
}

No comments:

Post a Comment