、求s = 1!+2!+3!+4!+...+20! 结果: 2561327494111820300.000000
时间: 2023-11-24 08:06:54 浏览: 107
以下是Python代码实现:
```python
import math
s = 0
for i in range(1, 21):
s += math.factorial(i)
print("s = %.6f" % s) # 输出:s = 2561327494111820300.000000
```
阅读全文