mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-12-16 15:44:39 +00:00
17 lines
207 B
C
17 lines
207 B
C
|
#include <stdio.h>
|
||
|
|
||
|
int main() {
|
||
|
int n;
|
||
|
double ans = 0;
|
||
|
|
||
|
scanf("%d", &n);
|
||
|
|
||
|
for (int i = 0; i < n; i++) {
|
||
|
ans += 1.0 / (i * 2 + 1);
|
||
|
}
|
||
|
|
||
|
printf("%.2lf\n", ans);
|
||
|
|
||
|
return 0;
|
||
|
}
|