#include < "stdafx.h"
IntMain){
Constint MAX =10000;
int carry_ =0;Carry
int temp =1;Product
int Num[max] = {0};The number of saved
int num_n =1;Array subscript Count
num[0] =1;Array first bit save 1
for (int i =2,nloc=0;i<=100;i++)Multiply starting from 2
{
temp=0,carry_=0;Small table Initialization product initialization carry initialization
for (Int J =0;j<num_n;j++)
{
temp = num[j] * i + carry_;Current array value x factorial current value + carry number
NUM[J] = temp%10;//greater than 10 take low
Carry_ = temp/10; //greater than 10 take high
}
if (carry_> 0) //in 15 factorial there are two digits but only one
// Use this to make two bits all saved
{
Num[num_n] = carry_% 10;
Carry_ = carry_/10;
num_n++;
if (Carry_>0)
{
Num[num_n] = carry_% 10;
Carry_ = temp/10;
num_n++;
}
}
}
//print
while (num_n)
{
cout << num[num_n-1]; //under bidding clubs refers to the output number of the previous bit to minus 1 otherwise it will be played 0
num_n--;
}
} /span>
Large number factorial (100!)