Guest User

Untitled

a guest
Feb 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5. int change(int x) {
  6. string change = to_string(x);
  7. string temp = change;
  8. for (int i = 0; i < change.length(); i++) {
  9. temp[change.length() - (i + 1)] = change[i];
  10. }
  11. return atoi(temp.c_str()); // string -> int 변환함수
  12. }
  13.  
  14. int main() {
  15. int x, y;
  16.  
  17. cin >> x;
  18. cin >> y;
  19.  
  20. x = change(x);
  21. y = change(y);
  22.  
  23. (x > y) ? printf("%d\n", x) : printf("%d\n", y);
  24. }
Add Comment
Please, Sign In to add comment