Last active
February 23, 2018 17:11
-
-
Save LVMBDV/f9531309a62612fe8f6c4c5e99ecde93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum = 0 | |
(1..1000).each { |number| | |
if (number.divisible_by? 3) || (number.divisible_by? 5) | |
sum += number | |
end | |
} | |
puts sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment