algorithms-go/other/斐波拉契数列/main.go
2021-04-07 14:27:14 +08:00

14 lines
168 B
Go

package main
import "fmt"
func main() {
fmt.Println(fibonacci(36))
}
func fibonacci(i int) int {
if i < 2 {
return i
}
return fibonacci(i-2) + fibonacci(i-1)
}