fork(1) download
  1.  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. const int TEN = 10;
  6.  
  7. int main() {
  8. int a, b, counterA = 0, counterB = 0;
  9. cin >> a >> b;
  10. int copyA = a, copyB = b;
  11. while (a || b) {
  12. if (a % 2 && a > 0) {
  13. ++counterA;
  14. }
  15. if (b % 2 && b > 0){
  16. ++counterB;
  17. }
  18. a /= TEN;
  19. b /= TEN;
  20. }
  21. if (counterA >= counterB) {
  22. cout << copyA;
  23. } else {
  24. cout << copyB;
  25. }
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 5268KB
stdin
1000000000 2
stdout
1000000000