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

PROGRAMMING:Find the sum of 1 + 1 / 2 + 1 / 4 + 1 / 6 +... + 1 / n

Luz5年前 (2021-05-10)题库494
Find the sum of 1 + 1 / 2 + 1 / 4 + 1 / 6 +... + 1 / n.
This problem requires: input a positive even number n arbitrarily, calculate the sum of fractions whose denominator is even number, if input 6, then calculate 1 + 1 / 2 + 1 / 4 + 1 / 6, the value range of n is [2100]. Output the final calculation result with two decimal places.
###Input format:
Give a positive even number N in a row.
###Output format:
Output the calculation result in one line, accurate to two decimal places.
###Input example:
```in
six
```
###Output example:
```out
one point nine two
```







answer:If there is no answer, please comment