#212. 判断数字末位是否相同
判断数字末位是否相同
Same Last Digit
Background
Congcong is learning about number properties. He wants to know how to determine if two numbers have the same last digit.
Problem Description
Given two non-negative integer values, return true if they have the same last digit, such as with and . Note that the % (mod) operator computes remainders, so is .
Input Format
Input is given from standard input in the following format.
a b
Output Format
Output is printed to standard output in the following format.
result
Sample
7 17
true
6 17
false
3 113
true
Sample Explanation
- Sample 1: , and . Their last digits are both , so
trueis returned. - Sample 2: , and . Their last digits are different, so
falseis returned. - Sample 3: , and . Their last digits are both , so
trueis returned.
Constraints
Time limit: second per test case. Memory limit: KiB per test case.