JAVA分别用do-while和for循环计算前20项之和
分别用do-while和for循环计算1+1/2!+1/3!+1/4!+…前20项之和1.do-whilepublic class and { public static void main(String[] args){ double sum =0; int a=1; int i=1; do{ a*=i; sum +=1.0/a; i++; }while