#202. 递归实现阶乘计算
递归实现阶乘计算
Recursive Factorial
Background
Congcong has recently been learning about the concept of factorials in mathematics. He wants to know how to calculate the factorial of a number using programming, specifically requiring a recursive approach.
Problem Description
Given an integer of or more, return the factorial of , which is . Compute the result recursively (without loops).
Input Format
Input is given from standard input in the following format.
An integer .
Output Format
Output is printed to standard output in the following format.
The factorial of .
Sample
1
1
2
2
3
6
Constraints
Time limit: 1 second, Memory limit: 1024KB for each test case.