Skip to content

Instantly share code, notes, and snippets.

@ranamahmud
Created November 9, 2015 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ranamahmud/b2c532cdfc81aa43a5cd to your computer and use it in GitHub Desktop.
Save ranamahmud/b2c532cdfc81aa43a5cd to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main(){
int n,i=1 ,sum;
while(scanf("%d",&n)){
sum = 0;
if(n<0)
break;
sum = ceil(log2(n));
printf("Case %d: %d\n",i++,sum);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment