#T784. 阶乘和

阶乘和

Description

Given a positive integer n (n <= 100), let s = 1! + 2! + 3! + ... + n!. Here, '!' denotes the factorial operation, where n! = 1 × 2 × 3 × ... × (n-1) × n. For example, 3! = 1 × 2 × 3 = 6. Please implement a program that takes a positive integer n as input and outputs the computed value of s.

Input Format

A positive integer n.

Output Format

The computed result s.

4
33

译文

CodesOnline