6 lines
No EOL
100 B
Ruby
Executable file
6 lines
No EOL
100 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
|
|
sum = 0;
|
|
(1..999).each { |i| sum += i if (i % 3 == 0 || i % 5 == 0) }
|
|
|
|
puts sum |