1042: 数列求和3
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);int n,x=1;double sum=0;n=cin.nextInt();for(int i=1;i<=n;i++){
sum+=1.0*i/(2*i-1)*x;x=-x;}System.out.printf("%.3f",sum);}
}