30. Factorial
Foundation1000 ms256 MBSolved by 0%
Read an integer n and print n! — the product of all integers
from 1 to n.
By definition 0! = 1.
Constraints - `0 ≤ n ≤ 20`
Input
A single line containing one integer n.
Output
Print one integer — the factorial of n.
Input5
Output120
Noteis a small factorial
Input0
Output1
Noteis zero factorial, which is defined as 1 and which an empty loop must produce
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution