#127. 3或5的非同时倍数判断
3或5的非同时倍数判断
Multiple of 3 or 5 (Not Both)
Background
Dawei and Xiaoxiao are playing a number game. They want to determine if a given non-negative integer satisfies a special condition.
Problem Description
Given a non-negative integer, return true if it is a multiple of or , but not both. Use the % (modulo) operator.
Input Format
Input is given from Standard Input in the following format.
A non-negative integer .
Output Format
Output is to Standard Output in the following format.
Output
trueif the condition is met, otherwisefalse.
Sample
3
true
10
true
15
false
Sample Explanation
- For Sample , the input is . is a multiple of but not . The condition (multiple of or , but not both) is met, so output
true. - For Sample , the input is . is not a multiple of but is a multiple of . The condition is met, so output
true. - For Sample , the input is . is a multiple of both and . The condition (not both) is not met, so output
false.
Constraints
The input integer satisfies . Time limit: second, Memory limit: KiB for each test case.