← 返回 cisco 的题目列表FizzBuzz Problem
类型:online_judge
When given a number N, for each integer i in the range from 1 to N inclusive, print one value per line as follows:
If i is a multiple of both 3 and 5, print FizzBuzz.
If i is a multiple of 3 but not 5, print Fizz.
If i is a multiple of 5 but not 3, print Buzz.
If i is not a multiple of 3 or 5, print the value of i.
Input description: The input consists of an integer - inputNum, representing the given number (N).
Output description: Print a line-separated output based on the given instructions for each value i in the set {1, 2, ... N} in ascending order.
Example:
Input: 5 Output: 1 2 Fizz 4 Buzz
Example
Input
5