codingtests/solutions/Generic/FIZZBUZZ/solve.rb

12 lines
170 B
Ruby
Raw Normal View History

2012-03-01 12:40:45 +00:00
(1..100).each do |i|
if(i % 3 == 0)
print "Fizz";
end
if(i % 5 == 0)
print "Buzz"
end
if(i % 3 != 0 and i % 5 != 0)
print i
end
print "\n";
end