fjord/fizzbuzz.rb

12 lines
155 B
Ruby
Raw Normal View History

2024-03-09 13:29:34 +09:00
(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