Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. ios_base::sync_with_stdio(0);
  7. cin.tie(0);
  8. cout.tie(0);
  9.  
  10. char c1, c2;
  11. cin >> c1 >> c2;
  12. int a1 = c1;
  13. int a2 = c2;
  14.  
  15. if(a1 - 32 == a2) cout << c2 << " " << c1;
  16. else if(a2 - 32 == a1) cout << c1 << " " << c2;
  17. else if(a1 < 91 && a2 < 91 || a1 > 96 && a2 > 96)
  18. if(a2 > a1) cout << c1 << " " << c2;
  19. else cout << c2 << " " << c1;
  20. else if(a1 < 91 && a2 > 96)
  21. if(a1 + 32 > a2) cout << c2 << " " << c1;
  22. else cout << c1 << " " << c2;
  23. else if(a1 > 96 && a2 < 91)
  24. if(a2 + 32 > a1) cout << c1 << " " << c2;
  25. else cout << c2 << " " << c1;
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement