navigator.lua/playground/go/fib.go

9 lines
92 B
Go

package main
func Fib(n int) int {
if n < 2 {
return n
}
return Fib(n-1) + Fib(n-2)
}