7 lines
96 B
Ruby
7 lines
96 B
Ruby
|
sum = 0
|
||
|
(1..1000).each do |i|
|
||
|
if(i % 3 == 0 or i % 5 == 0)
|
||
|
sum += i
|
||
|
end
|
||
|
end
|
||
|
puts sum
|