比较简单的算法,只要采用一个单重循环就可以解决问题的:#includeint main(){ int i; double e=1,t=1; for(i=1;t>1e-13;i++) {t/=i; e+=t; } printf("%.12f\n",e); return 0;}