Alx09

Untitled

Feb 18th, 2019
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. long long n,nr=0;
  7. cin >> n;
  8.  
  9. while(n % 2 == 0)
  10. {
  11. n/=2;
  12. nr++;
  13. }
  14. if(n == 1) cout<<nr;
  15. else cout << -1;
  16.  
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment