Created
July 24, 2012 10:30
-
-
Save kitak/3169306 to your computer and use it in GitHub Desktop.
problem2
This file contains hidden or 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
# coding- utf-8 | |
sum = 2 | |
t = 1 | |
t2 = 2 | |
while (t + t2) < 4000000 | |
tmp = t2 | |
t2 = t + t2 | |
t = tmp | |
if t2 % 2 == 0 | |
sum += t2 | |
end | |
end | |
puts sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment