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

PROGRAMMING:Find the sum of sequence 2 / 1, 3 / 2, 5 / 3

Luz5年前 (2021-05-10)题库371
Function: find the sum of the first n items of a fractional sequence 2 / 1, 3 / 2, 5 / 3, 8 / 5, 13 / 8, 21 / 13.
Note: the denominator of each fraction is the sum of the denominators of the first two items, and the numerator of each fraction is the sum of the numerators of the first two items
For example, the sum of the first 20 items is 32.660.
###Input format:
Enter an integer n to find the sum of the first n terms, 1 < = n < = 100.
###Output format:
Output the sum of the first n series, and keep 3 decimal places.
###Input example:
```in
twenty
```
###Output example:
```out
thirty-two point six six zero
```







answer:If there is no answer, please comment