Skip to content

Commit

Permalink
Merge pull request #232 from hurlenko/fibonacci_go
Browse files Browse the repository at this point in the history
Add fibonacci in go
  • Loading branch information
wzhouwzhou authored Oct 31, 2018
2 parents cdf029b + e0563ae commit 72ff2ca
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions go/fibonacci.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
"fmt"
)

func main() {
fmt.Println(fib(10))
}

func fib(n float64) float64 {if n < 2 { return n } else {return fib(n-1) + fib(n-2)}}

0 comments on commit 72ff2ca

Please sign in to comment.