HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Ad-Hoc > problem:


50882 - FizzBuzz

Guest
• Discussion of problem (1)

Section problems

• 50493 - n-digit kth Prime Number
• 50520 - Filling a Matrix Randomly
• 50454 - What day is it?
• 50474 - Sum of Two Primes
• 50597 - Drawing Diamonds
• 50253 - Timer
• 50294 - Centimeters to Yards
• 50303 - Pattern
• 50882 - FizzBuzz
• 50322 - Snake Pattern
• 50302 - Paper Scissors Rock
• 50396 - Cinema Tickets - 1
• 50366 - Student Averages (2 Grades)
• 50357 - Convert Euros into Dollars
• 50466 - Drawing Square From Stars
• 50351 - Convert inches to cm
• 50356 - Hours Passed

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Halil Karimis. Difficulty Alpha

Fizz Buzz

Johnny wanted to show the numbers from 1-N (0< N <1000). But, his computer is broken and started to show ”Fizz” for every multiple of "3" and “Buzz” for every multiple of “5”.

If a number is both a multiple of 3 and 5 it outputs “Fizz Buzz”.

Otherwise it prints the numbers with a space in between them.

Because this error is really fascinating. You are asked to write a program that simulates this error.

Input specification
An integer number N

Output specification
A series of numbers from 1-N and the words “Fizz” , “Buzz” used accordingly.

Sample Input I
5
Sample Input II
16
Sample Output I
1 2 Fizz 4 Buzz
Sample Output II
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 Fizz Buzz 16


Äëÿ îòïðàâêè ðåøåíèé íåîáõîäèìî âûïîëíèòü âõîä.

www.contester.ru