Enter a positive integer n, Output n! Value . among n!=123…n.
n! It could be very big , The range of integers that a computer can represent is limited , We need to use the method of high precision calculation . Use an array A To represent a large integer a,A Express a A bit of ,A Express a Top ten , By analogy . take a Multiply by an integer k Change to array A Every element of the matrix is multiplied by k, Please pay attention to the corresponding carry . First of all, will a Set to 1, Then take 2, ride 3, When you get to n when , taken n! Value .
The input contains a positive integer n,n<=1000.
Output n! The exact value of .
The sample input
3628800 Particular attention n First of all, recursion can only solve 1 Factorials up to a few hundred
n = int(input())a = b =1while a <= n: b = b * a a += 1print(b)