Added more tests
This commit is contained in:
parent
8974b8b0aa
commit
453b4d8956
5 changed files with 42 additions and 33 deletions
|
@ -1,19 +0,0 @@
|
|||
import sys
|
||||
|
||||
main() {
|
||||
let f = fibonacci(11)
|
||||
sys.exit(f)
|
||||
}
|
||||
|
||||
fibonacci(n Int) -> Int {
|
||||
mut b = 0
|
||||
mut c = 1
|
||||
|
||||
for 0..n {
|
||||
let a = b
|
||||
b = c
|
||||
c = a + b
|
||||
}
|
||||
|
||||
return b
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue