Friday, December 2, 2016

【UVa】11636 - Hello World!

Problem here

Solution

water water water water ~~~
#include <iostream>
using namespace std;

int main(){

    int n;
    int kase = 1;
    while(cin >> n){
        if(n < 0)
            break;

        int ans = 1;
        int cnt = 0;
        while(ans < n){
            ans = ans * 2;
            cnt++;
        }
        cout << "Case " << kase++ << ": " << cnt << endl;
    }
    return 0;
}