We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func fibonacci(value int) []int { x := make([]int, value) x[0], x[1] = 1, 1 for n := 2; n < value; n++ { x[n] = x[n-1] + x[n-2] } return x }
原函数在参数为1时会报错
1
func fibonacci(n int) []int { arr := make([]int, n) a, b := 0, 1 for i := 0; i < n; i++ { a, b = b, a+b arr[i] = a } return arr }
参考了:fib.go
The text was updated successfully, but these errors were encountered:
fixed issue #15
8802a13
mikespook
No branches or pull requests
原函数在参数为
1
时会报错参考了:fib.go
The text was updated successfully, but these errors were encountered: