fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. { int count = 0;
  6. int a, b;cin >> a >> b;
  7. bool check = true;
  8. while (check)
  9. {
  10. if (a <= b)
  11. {
  12. a += a;
  13. count++;
  14. }
  15.  
  16. if (a > b)
  17. {
  18. check = false;
  19. }
  20. }
  21.  
  22. cout << count;
  23.  
  24. return 0;
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
1