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