fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int k = 999;
  6. int i = 1;
  7. int p = 0;
  8. while (k > i) {
  9. i*=2;
  10. p++;
  11. }
  12. cout << p << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
10