#C7648. FizzBuzz Simulation
FizzBuzz Simulation
FizzBuzz Simulation
This problem requires you to simulate a classic FizzBuzz game. Given an integer \(N\), your task is to print numbers from 1 to \(N\). For each number:
- If the number is divisible by 3 (i.e., \(i \mod 3 = 0\)), print Fizz.
- If the number is divisible by 5 (i.e., \(i \mod 5 = 0\)), print Buzz.
- If the number is divisible by both 3 and 5 (i.e., \(i \mod 15 = 0\)), print FizzBuzz.
- Otherwise, print the number itself.
Each output should be printed on a new line.
inputFormat
The input is provided via stdin and consists of a single integer (N) which represents the upper bound (inclusive) for the numbers in the game.
outputFormat
Print the result for each number from 1 to (N) on a new line according to the rules of the FizzBuzz game. That is, print the number itself if it is not divisible by 3 or 5, print Fizz if the number is divisible by 3, print Buzz if it is divisible by 5, and print FizzBuzz if it is divisible by both 3 and 5.## sample
1
1
</p>