7 lines
96 B
Ruby
Raw Normal View History

2012-03-01 11:35:34 +01:00
sum = 0
(1..1000).each do |i|
if(i % 3 == 0 or i % 5 == 0)
sum += i
end
end
puts sum