import java.util.Scanner;
public class Eext {
public static void main(String[] args) {
/*
求出 1- 1/2 + 1/3 -1/4 ... 1/100 的和
思路分析
1. 1- 1/2 + 1/3 -1/4 ... 1/100 = (1/1) - (1/2) + (1/3) -(1/4)...(1/100)
一共有100个数
2.当分母为奇数时,前面是 + ,当分母为偶数时,前面是 -
*/
double num = 0;
for (int i = 1; i <= 100; i++) {
if (i % 2 != 0) {
num += 1.0/i;
}else {
num -= 1.0/i;
}
}
System.out.println(num);
}
}