The factorial of the integer n, written n!, is defined as:
n! = n x (n-1) x (n-2) x ... x 3 x 2 x 1
Calculate and print the factorial of a given integer.
Note: Factorials of n > 20 can't be stored even in a 64bit long long variable. Big integers must be used for such calculations. We recommend solving this challenge using BigIntegers.
The factorial of the integer n, written n!, is defined as:
n! = n x (n-1) x (n-2) x ... x 3 x 2 x 1
Calculate and print the factorial of a given integer.
Note: Factorials of n > 20 can't be stored even in a 64bit long long variable. Big integers must be used for such calculations. We recommend solving this challenge using BigIntegers.