-->
当前位置:首页 > 题库

PROGRAMMING:Calculate factorial

Luz5年前 (2021-05-10)题库504
Enter a non negative integer n to calculate its factorial. It is defined as:
$$n! = \ left\{\begin{matrix}
1 \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \, \, \, \, \, \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \: if \: \: \: \, n = 0
\\
n\times (n-1)\times (n-2)\times... \times 2\times1\: \: \: \: \: \: if \, \, \, n>0
\end{matrix}\right.$$
###Input format:
Enter an integer n
###Output format:
Factorial of output n
###Input sample 1:
Here is a set of inputs. For example:
```in
0
```
###Output sample 1:
The corresponding output is given here. For example:
```out
one
```
###Input sample 2:
Here is a set of inputs. For example:
```in
three
```
###Output sample 2:
The corresponding output is given here. For example:
```out
six
```
###Input sample 3:
Here is a set of inputs. For example:
```in
five
```
###Output sample 3:
The corresponding output is given here. For example:
```out
one hundred and twenty
```






answer:If there is no answer, please comment