Monday, June 6, 2016

UVa 11847 - Cut the Silver Bar

// UVa 11847 - Cut the Silver Bar
#include <iostream>
#include <cmath>
using namespace std;

int main() {
	int n;
	cin >> n;
	while (n) {
		cout << int(floor(log(n) / log(2))) << endl;
		cin >> n;
	}
}

No comments:

Post a Comment