#C14820. Factorial Calculation
Factorial Calculation
Factorial Calculation
Given a non-negative integer \(n\), compute its factorial using recursion.
The factorial is defined as follows:
\( n! = \begin{cases} 1 & \text{if } n = 0,\\ n \times (n-1)! & \text{if } n > 0 \end{cases} \)
For example, when \( n = 5 \), the factorial \( 5! = 120 \).
inputFormat
The input consists of a single non-negative integer \(n\) in one line. You can assume \(0 \leq n \leq 20\).
outputFormat
Output the factorial of \(n\) on a single line.
## sample0
1