fizzbuzz
This commit is contained in:
parent
aa92ee1d42
commit
0d8e96bd3a
1 changed files with 11 additions and 0 deletions
11
fizzbuzz.rb
Executable file
11
fizzbuzz.rb
Executable file
|
@ -0,0 +1,11 @@
|
|||
(1..20).each do |x|
|
||||
if x % 15 == 0
|
||||
puts 'FizzBuzz'
|
||||
elsif x % 3 == 0
|
||||
puts 'Fizz'
|
||||
elsif x % 5 == 0
|
||||
puts 'Buzz'
|
||||
else
|
||||
puts x
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue