Problem2135--阶乘之和

2135: 阶乘之和

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

# [NOIP1998 普及组] 

## 题目描述

用高精度计算出 $S = 1! + 2! + 3! + \cdots + n!$($n \le 50$)。

其中 `!` 表示阶乘,定义为 $n!=n\times (n-1)\times (n-2)\times \cdots \times 1$。例如,$5! = 5 \times 4 \times 3 \times 2 \times 1=120$。

Input

一个正整数 $n$。
对于 $100 \%$ 的数据,$1 \le n \le 50$。

Output

一个正整数 $S$,表示计算结果。

Sample Input Copy

3

Sample Output Copy

9

HINT

学习数组,学习高精度乘法和高精度加法

Source/Category

admin