Created
December 17, 2015 05:11
-
-
Save yumechi/1440ee320ca36de60db9 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
inp = gets.to_i | |
y, z = 0, 1 | |
a, b = 2, 3 | |
for i in 1..inp do | |
if i % 2 == 1 | |
y += a | |
a += b | |
else | |
z += b | |
b += a | |
end | |
end | |
puts y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment