fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6.  
  7.  
  8. int n;
  9. bool go(int n) {
  10. int temp = n % 2;
  11. if (n == 1) return true;
  12. else if (temp == 1) return false;
  13. else go(n / 2);
  14. }
  15.  
  16.  
  17. int main() {
  18. cin >> n;
  19. if (go(n)) cout << 1 << endl;
  20. else cout << 0 << endl;
  21. }
Runtime error #stdin #stdout 0s 4536KB
stdin
2
stdout
Standard output is empty