Larger Value (Ternary)
Easyjava
Read two integers and print the larger one using a single ternary expression.
Input: two integers separated by whitespace.
Output: one line — the larger value.
Example 1
Input
5 3
Output
5
Example 2
Input
2 9
Output
9
- -1000000000 <= a, b <= 1000000000
Hint 1
(a > b) ? a : b returns the larger of the two.
Hint 2
When a and b are equal, either branch gives the same value.
The ternary chooses a when a is greater, otherwise b. This replaces a four-line if-else with a single expression.