#T415. 1~N的阶乘和

1~N的阶乘和

Description

Calculate the value of Sn=1!+2!+3!+4!+5!+…+n!, where n is a number.


Note: Since the value of n can be relatively large, Sn should be defined as a long long type.

Input Format

Input an integer N

Output Format

Output a number representing the sum of factorials from 1 to N

i.e.: Sn=1!+2!+3!+4!+5!+…+n!


Note: If using printf, the output format specifier should be %lld

```input1 5 ``` ```output1 153 ``` ## 翻译结果

CodesOnline

(注:由于"CodesOnline"是一个专有名词或品牌名称,通常保持原样不翻译。如果上下文需要解释,可以补充说明其含义,例如"代码在线平台"或"在线编程服务"等,但此处仅作直译处理)