#134. FizzBuzz数字转换
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 , return the string form of the number followed by '!'.
However, there are special rules:
- If is divisible by , use 'Fizz' instead of the number.
- If is divisible by , use 'Buzz' instead of the number.
- If is divisible by both and , use 'FizzBuzz' instead of the number.
Note: The modulo operator '%' computes the remainder after division. For example, yields . When one number divides evenly into another, the remainder is .
Input Format
Input is given from Standard Input in the following format.
Output Format
Output to Standard Output in the following format.
The resulting string
Sample
1
"1!"
2
"2!"
3
"Fizz!"
Sample Explanation
For input , it is not divisible by or , so the output is the number followed by '!', i.e., "1!". For input , it is not divisible by or , so the output is the number followed by '!', i.e., "2!". For input , it is divisible by but not by , so the output is 'Fizz' followed by '!', i.e., "Fizz!".
Constraints
Time limit: 1s, Memory limit: 1024KiB for each test case.