Advertisement
skb50bd

UVa 11636 Hello World

Aug 28th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.     int R, T, S, cas = 0, max;
  7.     while(true) {
  8.         cin >> R;
  9.         if(R < 0) break;
  10.         for(int i = 0; i < 50; i++)
  11.             if(pow(2,i) >= R) {
  12.                 S = i;
  13.                 break;
  14.             }
  15.         cout << "Case " << ++cas << ": " << S << endl;
  16.     }
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement