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

PROGRAMMING:Calculate pi

Luz5年前 (2021-05-10)题库397
According to the following relation, calculate the value of PI until the value of the last term is less than the given threshold.
$$\frac{\pi}{2} = 1+\frac{1}{3} + \frac{2!}{ 3\times 5}+ \frac{3!}{ 3\times 5\times 7}+\cdots + \frac{n!}{ 3\times 5\times 7\times \cdots \times (2n+1)}+\cdots$$
###Input format:
The input gives a threshold of less than 1 in one line.
###Output format:
Output the approximate PI satisfying the threshold condition in one line to 6 decimal places.
###Input example:
```in
zero point zero one
```
###Output example:
```out
three point one three two one five seven
```






answer:If there is no answer, please comment