import java.util.*;
public class APP1{public static void main(String[] args){double sum=0.0;int n=0;int flag=1;int fm=1;Scanner reader =new Scanner(System.in);System.out.println("请输入n的值:");n=reader.nextInt();for(int i=0;i<=n;i++){fm*=i; //阶乘sum+=(flag*1.0)/fm;flag=-flag; //变号}System.out.println("sum的值为"+sum);}
}