public class factorial2{
public static void main(String arg[]){
double a,b=1,c=0;
System.out.println("1!+1/2!+1/3!+1/4!+....的前20项和:");
for(a=1;a<=20;a++){
b*=1/a;
c+=b;
}
System.out.println(c);
}
}
1!+1/2!+1/3!+1/4!+....的前20项和
最新推荐文章于 2022-03-27 09:59:41 发布