fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string s;
  7. cin >> s;
  8. if (s.length() == 2){
  9. if (s[1] == '0') {
  10. cout << s[0];
  11. return 0;
  12. }
  13. }
  14. int t = s[1];
  15. s[1] = s[s.length() - 2];
  16. s[s.length() - 2] = t;
  17. cout << s;
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5324KB
stdin
20
stdout
2