public class jia { public static void main(String[] args) { // TODO 自动生成的方法存根 double jiecheng=1; double sum=0; int j=0; for(int i=1;i<20;i++) { do { j++; jiecheng=jiecheng*j; } while(j<i); //System.out.println(jiecheng); sum=sum+1jiecheng; } System.out.println("1+1/2!+1/3!+1/4!+...1/20!="+sum); } }