Sangsu
InterviewTime limit1sMemory limit128 MB
Reverse two given three-digit numbers digit by digit and print the larger reversed value.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Sangsu, Sanggeun's younger brother, has trouble with math. In particular, he does not read numbers from left to right; he always reads them from right to left.
Sanggeun shows Sangsu two three-digit numbers and asks which number is larger after Sangsu reads both numbers in his reversed way. For example, if 734 and 893 are given, Sangsu reads them as 437 and 398, so he answers 437.
Given two three-digit numbers, write a program that prints Sangsu's answer.
Input
The first line contains two three-digit numbers A and B, separated by a space. The two numbers are different, and neither number contains the digit 0.
Output
Print the larger number after Sangsu reads both numbers in reverse.