fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int f(int n)
  5. {
  6. if ((n%2==1) || (n==0)) return 0;
  7. else return 1+f(n/2);
  8. }
  9.  
  10. int x;
  11.  
  12. int main() {
  13.  
  14. cin>>x;
  15. cout<<f(x)<<endl;
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 5312KB
stdin
14
stdout
1