pyar6329
1/9/2016 - 7:12 PM

fizzbuzz

fizzbuzz

print 'Please Input Numbers: '
str = STDIN.gets.to_i

def judge_fizzbuzz(str)
  print 'Fizz' if str % 3 == 0
  print 'Buzz' if str % 5 == 0
  print 'No FizzBuzz' unless str % 3 == 0 || str % 5 == 0
  puts ''
end

str.times do | s |
  print s.to_s + ' '
  judge_fizzbuzz(s)
end