-->
当前位置:首页 > 题库

PROGRAMMING:Function Fibonacci sequence

Luz5年前 (2021-05-10)题库466
Fibonacci sequence, also known as golden section sequence, refers to such a sequence: 1, 1, 2, 3, 5, 8, 13, 21. In mathematics, Fibonacci sequence is defined by recursion as: F (1) = 1, f (2) = 1, f (n) = f (n-1) + F (n-2) (n ≥ 2, n ∈ n). Calculate the value of the nth term of Fibonacci sequence.
Input format:
Enter an integer n greater than or equal to 1 and less than or equal to 60.
Output format:
Output the sequence value of the nth item. The sequence value is of double type, and no decimal digits are output.
Input example:
twenty
Output example:
six thousand seven hundred and sixty-five
Input example:
one
Output example:
1






answer:If there is no answer, please comment