Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
好吧,我真的需要有人帮我解决这个问题。谢谢!
使用代数和e函数定义,|e(n) - e(n+1)| < x可以简化为(1/n!) < x,可以展开为(1/1) * (1/2) * (1/3) * ... * (1/n) < x。
e
|e(n) - e(n+1)| < x
(1/n!) < x
(1/1) * (1/2) * (1/3) * ... * (1/n) < x
int minN(double x) { double sum = 1; int n; for(n = 0; sum >= x; n++) { sum *= 1/(n+1); } return n; }