#134. FizzBuzz数字转换

    ID: 134 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatLogic-1gesp1条件结构数学基础

FizzBuzz数字转换

FizzBuzz!

Background

Dawei is teaching programming basics, and one classic exercise is FizzBuzz. Now, Congcong is asked to complete a slightly modified version.

Problem Description

Given an integer nn, return the string form of the number followed by '!'.

However, there are special rules:

  • If nn is divisible by 33, use 'Fizz' instead of the number.
  • If nn is divisible by 55, use 'Buzz' instead of the number.
  • If nn is divisible by both 33 and 55, use 'FizzBuzz' instead of the number.

Note: The modulo operator '%' computes the remainder after division. For example, 23(mod10)23 \pmod{10} yields 33. When one number divides evenly into another, the remainder is 00.

Input Format

Input is given from Standard Input in the following format.

nn

Output Format

Output to Standard Output in the following format.

The resulting string

Sample

1
"1!"
2
"2!"
3
"Fizz!"

Sample Explanation

For input 11, it is not divisible by 33 or 55, so the output is the number 11 followed by '!', i.e., "1!". For input 22, it is not divisible by 33 or 55, so the output is the number 22 followed by '!', i.e., "2!". For input 33, it is divisible by 33 but not by 55, so the output is 'Fizz' followed by '!', i.e., "Fizz!".

Constraints

Time limit: 1s, Memory limit: 1024KiB for each test case.