Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- char c1, c2;
- cin >> c1 >> c2;
- int a1 = c1;
- int a2 = c2;
- if(a1 - 32 == a2) cout << c2 << " " << c1;
- else if(a2 - 32 == a1) cout << c1 << " " << c2;
- else if(a1 < 91 && a2 < 91 || a1 > 96 && a2 > 96)
- if(a2 > a1) cout << c1 << " " << c2;
- else cout << c2 << " " << c1;
- else if(a1 < 91 && a2 > 96)
- if(a1 + 32 > a2) cout << c2 << " " << c1;
- else cout << c1 << " " << c2;
- else if(a1 > 96 && a2 < 91)
- if(a2 + 32 > a1) cout << c1 << " " << c2;
- else cout << c2 << " " << c1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement