计算 1+1/2!+1/3!+1/4!+...1/20!=?
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+1/jiecheng; } System.out.println("1+1/2!+1/3!+1/4!+...1/20!="+sum);