Last active
February 23, 2018 17:12
-
-
Save LVMBDV/21e77ccd111ffa1d831c7bd5ebe60abd 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, x, y, z = 0, 1, 2, 3 | |
while z <= 4000000 | |
z = x + y | |
x = y | |
y = z | |
sum += z if z.divisible_by? 2 | |
end | |
puts sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment