#139. 判断三个数是否有相同个位数
判断三个数是否有相同个位数
Same Rightmost Digit
Background
Congcong is currently learning about number properties. He wants to know if, given three integers, at least two of them have the same rightmost digit.
Problem Description
Given three non-negative integers , , , return true if two or more of them have the same rightmost digit. The integers are non-negative. Note: the % "mod" operator computes the remainder, e.g. is .
Input Format
Input is given from Standard Input in the following format.
a b c
Output Format
Output is printed to Standard Output in the following format.
trueorfalse
Sample
23 19 13
true
23 19 12
false
23 19 3
true
Sample Explanation
Sample 1:
The rightmost digit of is , the rightmost digit of is , and the rightmost digit of is . Since and both have as their rightmost digit, true is returned.
Sample 2:
The rightmost digit of is , the rightmost digit of is , and the rightmost digit of is . No two or more integers have the same rightmost digit, so false is returned.
Sample 3:
The rightmost digit of is , the rightmost digit of is , and the rightmost digit of is . Since and both have as their rightmost digit, true is returned.
Constraints
Time limit: 1 second, Memory limit: 1024 KiB for each test case.