第2个回答 2013-10-12
public class Test{
public static void main(String[] args){
System.out.println(show());
}
public static double show(){
double result = 0.0;
for(int i = 0;i<=20;i++){
int fac = 1;
for(int j=1;j<=i;j++){
fac*=j;
}
result+=1.0/fac;
}
return result;
}
}本回答被提问者和网友采纳