-
-
Save creaaa/01791f262f0eeb0d30d44dfc70625311 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
var first = 0 | |
var second = 1 | |
func fib() { | |
for _ in 1...10 { | |
print(first) | |
let result = first + second | |
first = second | |
second = result | |
} | |
} | |
fib() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment