Problem 806
Last Digit of a Number
Problem
Print the last digit of an integer N, the digit in its ones place. For a negative number, ignore the sign, so the last digit of -47 is 7. In code this is |N| mod 10. Be careful: in C++ and Java, -47 % 10 equals -7, so take the absolute value of N first.
Input
A single integer N.
Output
Print the last digit of N.
Constraints
-10^9 <= N <= 10^9
Example input
1234
Example output
4
Explanation
The ones digit of 1234 is 4, so the answer is 4. For -47 it would be 7.