challenges/e1.rb

12 lines
114 B
Ruby
Executable File

#!/usr/bin/ruby
sum = 0
for i in 2..999
if i % 3 == 0 or i % 5 == 0
sum += i
end
end
print sum.to_s + "\n"