#C14259. Fizz Buzz Challenge
Fizz Buzz Challenge
Fizz Buzz Challenge
The task is to implement the classic Fizz Buzz challenge. Given a positive integer \( n \), you are to print the numbers from 1 to \( n \). However, for multiples of 3, you should print Fizz instead of the number, for multiples of 5, print Buzz, and for numbers which are multiples of both 3 and 5, print FizzBuzz. The output should be displayed on the standard output, with each result on a new line.
For example, if \( n=15 \), the output should be:
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz
Please note that if the input \( n \) is 0 or a non-positive number, the output should be empty.
inputFormat
The input consists of a single integer \( n \) (\( 0 \leq n \leq 10^5 \)) provided via standard input.
outputFormat
Output the Fizz Buzz sequence for numbers from 1 to \( n \), each on a separate line. If \( n \) is 0, output nothing.
## sample15
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
</p>