#46. 判断3或5的倍数
判断3或5的倍数
Check Multiple of 3 or 5
Background
Congcong is learning basic mathematical operations. He wants to write a program to determine if a number is a multiple of 3 or 5.
Problem Description
Return true if the given non-negative number is a multiple of 3 or a multiple of 5; otherwise, return false. Use the % (modulus) operator -- see Introduction to Mod.
Input Format
Input is given from Standard Input in the following format.
A single line containing a non-negative integer .
Output Format
Output is printed to Standard Output in the following format.
A single line. Output
trueif is a multiple of 3 or 5; otherwise, outputfalse.
Sample
3
true
10
true
8
false
Sample Explanation
Sample 1: is a multiple of , so output true.
Sample 2: is a multiple of , so output true.
Sample 3: is neither a multiple of nor a multiple of , so output false.
Constraints
- Time limit: 1 second
- Memory limit: 1024KB