#K94547. FizzBuzz Challenge
FizzBuzz Challenge
FizzBuzz Challenge
You are given a single integer \(n\). Your task is to print the sequence of numbers from 1 to \(n\) with the following substitutions:
- For numbers divisible by 3, print Fizz instead of the number.
- For numbers divisible by 5, print Buzz instead of the number.
- For numbers divisible by both 3 and 5, print FizzBuzz instead of the number.
If \(n=0\), output nothing.
Note: Output the results in a single line separated by a single space without any extra spaces at the beginning or the end.
inputFormat
A single line containing one integer (n).
outputFormat
A single line containing the fizz buzz sequence for numbers from 1 to (n) separated by single spaces. If (n) is 0, output nothing.## sample
15
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz
</p>