FIZZBUZZ - FIZZBUZZ (Easy)
FizzBuzz is a game that is played in French elementary-school class, as a way to practice counting. The players take turns counting, starting with one and going up. The rules are simple: when your turn arrives, you say the next number. However, if that number is a multiple of five, you should say the word "fizz" instead. If the number is a multiple of seven, you should say "buzz." And if it is a multiple of both, you should say "fizzbuzz." If you mess up, you're out, and the game continues without you...
Given a Number, You just have to print 'fizz' (without quotes) if the number is multiple of five, print 'buzz' (without quotes) if the number is multiple of seven, and print 'fizzbuzz' (without quotes) if the number is multiple of both. If the number not belongs to these three categories then just print the number as given in input.
Input
Input contains a positive number T (T < 1000) which is the number of test cases followed by T lines containing an integer in each line of test case. (0 < integer number < 2^31).
Output
print 'fizz' (without quotes) if the number is multiple of five, print 'buzz' (without quotes) if the number is multiple of seven, and print 'fizzbuzz' (without quotes) if the number is multiple of both. If the number not belongs to these three categories then just print the number as given in input.
Score
Score is your code length.
Example
Input: 5 23 45 35 21 3 Output: 23 fizz fizzbuzz buzz 3
Added by: | ওয়াসী (Wasi) |
Date: | 2013-04-28 |
Time limit: | 1s |
Source limit: | 350B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | ADA95 ASM32 GAWK BASH BF C CSHARP C++ 4.3.2 CPP C99 CLPS CLOJURE LISP sbcl LISP clisp D ERL FSHARP FORTRAN GO HASK ICON ICK JAVA JS-RHINO LUA NEM NICE NODEJS OCAML PAS-GPC PAS-FPC PERL PERL6 PHP PIKE PRLG-swi PYTHON PYTHON3 PY_NBC RUBY SED |
Resource: | French elementary school |