n = 1;s = 1;ds = 1;f = n;while (ds>1e-5)s = s+ds;n=n+1;f = f*n;ds = 1/f;endfprintf('最小项数%d, 实际误差%f',n,(s-exp(1))/exp(1)).
確定! 回上一頁