33 lines
387 B
Markdown
33 lines
387 B
Markdown
|
# 阶乘和
|
||
|
|
||
|
## Tags
|
||
|
|
||
|
- C++一本通
|
||
|
- 高精度
|
||
|
|
||
|
## Description
|
||
|
|
||
|
已知正整数 $N (N\le100)$,设$S=1!+2!+3!+\cdots+N!$
|
||
|
|
||
|
其中 "!" 表示阶乘,即$N!=1\times 2\times 3\times\cdots\times (N-1)\times N$
|
||
|
|
||
|
如:$3!=1\times 2\times 3=6$
|
||
|
|
||
|
请编程实现:输入正整数$N$,输出计算结果$S$的值
|
||
|
|
||
|
## Example Cases
|
||
|
|
||
|
### Case 1
|
||
|
|
||
|
#### Input
|
||
|
|
||
|
```
|
||
|
4
|
||
|
```
|
||
|
|
||
|
#### Output
|
||
|
|
||
|
```
|
||
|
33
|
||
|
```
|