题解 | #斐波那契数列# | Golang
斐波那契数列
https://www.nowcoder.com/practice/ee5d403c1172487f8c7915b3c3d924c6
package main import ( "fmt" ) func fib(x int) int { if x <= 2 { return 1 } return fib(x-1) + fib(x-2) } func main() { n := 0 fmt.Scanln(&n) fmt.Print(fib(n)) }