This question will not, level too, the ability to convert the problem into a program is too weak, do not know which aspects are insufficient.
The best code for direct copy:
#include<iostream>#include<iomanip>using namespacestd;//to store factorial within 20000inta[15470]; Use arrays to store results, one five-digit number per elementintMain () { intN; CIN>>N; a[1]=1; a[0]=1; This a[0] is a counter that records the number of five digitsintUp ; Forward a five-digit number of rounding for(intI=2; i<=n;++i)//multiplier from 2 to n {up=0; Multiply by each multiplier and return to zero for(intj=1; j<=a[0];++J)//existing numeric digits participate in the operation{A[j]*=i; Multiply each five-digit number by multiplier A[j]+=Up ; Plus rounding up=a[j]/100000; Calculate the next carry A[j]%=100000; The value of the current five-digit number}if(up!=0) {a[0]++; If there is carry, the counter plus a a[a[0]]=Up ; Hold Carry}}if(a[0]==1) cout<<a[1]; Else{cout<<a[a[0]]; for(inti=a[0]-1;i>0; i--) {cout<<setfill ('0') <<SETW (5) <<A[i]; Top five-digit }}}
The large number factorial of Nanyang oj-