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