Easymathrecursion
Factorial
Time limit 2 s · Memory 64 MB
Statement
You are given an integer n. Print n! = 1 · 2 · … · n. By definition 0! = 1.
Constraints
0 ≤ n ≤ 20
Examples
Input 1
5
Output 1
120
Input 2
0
Output 2
1
Time limit 2 s · Memory 64 MB
You are given an integer n. Print n! = 1 · 2 · … · n. By definition 0! = 1.
0 ≤ n ≤ 20
5
120
0
1