#46. 判断3或5的倍数

    ID: 46 Type: Default 1000ms 256MiB Tried: 1 Accepted: 1 Difficulty: 10 Uploaded By: Tags>codingbatWarmup-1gesp1条件结构数学基础

判断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 nn.

Output Format

Output is printed to Standard Output in the following format.

A single line. Output true if nn is a multiple of 3 or 5; otherwise, output false.

Sample

3
true
10
true
8
false

Sample Explanation

Sample 1: 33 is a multiple of 33, so output true. Sample 2: 1010 is a multiple of 55, so output true. Sample 3: 88 is neither a multiple of 33 nor a multiple of 55, so output false.

Constraints

  • 0n1090 \le n \le 10^9
  • Time limit: 1 second
  • Memory limit: 1024KB