#D. C++-循环for-计算S=1/1-1/2+1/3-1/4+1/5-1/6...

    Type: Default 1000ms 256MiB

C++-循环for-计算S=1/1-1/2+1/3-1/4+1/5-1/6...

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

Description

C++-循环for-计算S=1/1-1/2+1/3-1/4+1/5-1/6...+(-)1/n

n是需要输入

image

Format

Input

Output

Samples

2
0.5
10
0.645635
100
0.688172

Limitation

1s, 1024KiB for each test case.

C++基础知识02(循环-for和while及嵌套)

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
18
Start at
2024-5-5 0:00
End at
2024-5-25 20:00
Duration
500 hour(s)
Host
Partic.
28