#Z14401. 求阶乘的和
求阶乘的和
Description
Given a positive integer n, calculate the sum of factorials of all positive integers not exceeding n (i.e., compute 1! + 2! + 3! + ... + n!) and output the result.
Input Format
The input consists of a single line containing a positive integer n (1 < n < 12).
Output Format
The output consists of a single line: the sum of factorials.
5
153
Related
In following homework: