Created
April 22, 2022 14:06
-
-
Save OlgaEle/8b3f2a9afd6259cb256c6a2a30e90c86 to your computer and use it in GitHub Desktop.
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
| macro fibo(n::Int64) | |
| f = [0,1] | |
| if n < 0 | |
| print("The input must be equal to or bigger than zero.") | |
| else | |
| for i in 3:n+1 | |
| push!(f, f[i-1] + f[i-2]) | |
| end | |
| end | |
| print(f[n+1]) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment