Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Kata del mes de Marzo del 2011: FizzBuzz
PHP Ruby Java C# Groovy Python Other
branch: master
Failed to load latest commit information.
JaviSoto Fix repo
MuDestructor Fix repo
NachE Fix repo
RobertoCastillo Fix repo
Sivainvi Fix repo
aabilio Fix repo
aesptux Fix repo
agutierrez Fix repo
aitortxu Fix repo
albertoperdomo_setepo Fix repo
alejandroSuch Fix repo
alejandrogomez kata finished.
alex952 Kata FizzBuzz
amaneiro Fix repo
amedio Fix repo
amuino Fix repo
animalaes Fix repo
armenta-angel Versión Mavenizada
arturoherrero Fix repo
athilha Fix repo
caic Fix repo
carlop Fix repo
cchau Added fizzBuzz.c written in C
cibernox My version
davidag Fix repo
diegoguevara Fix repo
discolo Fix repo
dobeslao Fix repo
dojosegovia Fix repo
drodriguez Fix repo
eamodeorubio Fix repo
eferro Fix repo
erpheus Ruby solution
funflin/php Stage 2 and change code style to Symfony2
germandz Fix repo
ggalmazor Fix repo
gonzalo123 Fix repo
harad Fix repo
hisie Fix repo
ialcazar Fix repo
j2sg Fix repo
jacegu print to a 100 as expected
japaz Fix repo
jcorbacho Agrego ejemplo en python tomado de otros autores
jgarciagarrido Fix repo
jjfalcon/delphi Fix repo
jjuarez/ruby Fix repo
jknito Fix repo
jlopez Fix repo
jmbeas Fix repo
jmfranco/KataMarzo Fix repo
jneira Fix repo
josmas Fix repo
jrdi fizzbuzz implemented on ruby
karlosgliberal Fix repo
kuraime Fix repo
lantoli Fix repo
maid450 Fix repo
manute Kata In Java
mgryszko Fix repo
nacmartin Fix repo
oscarramosp Stage 2 y pruebas de impresi�n finales
pacoguzman Fix repo
pereta segunda parte
porras/ruby Fix repo
prietopa Mes de marzo completado
rmhdev Fix repo
robjperez Fix repo
rsister88 Fix repo
sergiogragera/csharp Fix repo
sortega Fix repo
sourcerebels/groovy/src Fix repo
terrex Fix repo
theom3ga Fix repo
titosemi Fix repo
txingo Fix repo
vicentereig Fix repo
README Fix repo

README

Imagine the scene. You are eleven years old, and in the five minutes before the end of the lesson, your Maths teacher decides he should make his class more "fun" by introducing a "game". He explains that he is going to point at each pupil in turn and ask them to say the next number in sequence, starting from one. The "fun" part is that if the number is divisible by three, you instead say "Fizz" and if it is divisible by five you say "Buzz". So now your maths teacher is pointing at all of your classmates in turn, and they happily shout "one!", "two!", "Fizz!", "four!", "Buzz!"... until he very deliberately points at you, fixing you with a steely gaze... time stands still, your mouth dries up, your palms become sweatier and sweatier until you finally manage to croak "Fizz!". Doom is avoided, and the pointing finger moves on.

So of course in order to avoid embarassment infront of your whole class, you have to get the full list printed out so you know what to say. Your class has about 33 pupils and he might go round three times before the bell rings for breaktime. Next maths lesson is on Thursday. Get coding!

Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz?".

Sample output:

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
... etc up to 100
Stage 2 - new requirements

 * A number is fizz if it is divisible by 3 or if it has a 3 in it
 * A number is buzz if it is divisible by 5 or if it has a 5 in it

----------------------------------------------------------------------------

Enlace con la información original: http://www.codingdojo.org/cgi-bin/wiki.pl?KataFizzBuzz
Something went wrong with that request. Please try again.