1807. 斐波纳契数列简单
Posted yunxintryyoubest
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了1807. 斐波纳契数列简单相关的知识,希望对你有一定的参考价值。
1807. 斐波纳契数列简单
中文English
Find the Nth number in Fibonacci sequence.
A Fibonacci sequence is defined as follow:
- The first two numbers are 0 and 1.
- The i th number is the sum of i-1 th number and i-2 th number.
The first ten numbers in Fibonacci sequence is:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34 ...
样例
Example 1:
Input: 1
Output: 0
Explanation:
return the first number in Fibonacci sequence .
Example 2:
Input: 2
Output: 1
Explanation:
return the second number in Fibonacci sequence .
注意事项
N <= 20
以上是关于1807. 斐波纳契数列简单的主要内容,如果未能解决你的问题,请参考以下文章