主题:不懂请高手解释,谢谢
#include<iostream>
using namespace std;
int main()
{
const int MAXSIZE=100;
int array[MAXSIZE];
int n;
cout<<"n=";
cin>>n;
int sum,sc;
int i,j;
for (i=0;i<MAXSIZE;i++)
array[i]=0;
array[0]=1;
for(i=2;i<=n;i++)
{
sc=0;
for(j=0;j<MAXSIZE;j++)
{
sum=array[j]*i+sc;
sc=sum/10;
array[j]=sum%10;[/color] }
}
cout<<n<<"!=";
for(i=MAXSIZE-1;i>=0;i--)
cout<<array[i];
cout<<endl;
return 0;
}
using namespace std;
int main()
{
const int MAXSIZE=100;
int array[MAXSIZE];
int n;
cout<<"n=";
cin>>n;
int sum,sc;
int i,j;
for (i=0;i<MAXSIZE;i++)
array[i]=0;
array[0]=1;
for(i=2;i<=n;i++)
{
sc=0;
for(j=0;j<MAXSIZE;j++)
{
sum=array[j]*i+sc;
sc=sum/10;
array[j]=sum%10;[/color] }
}
cout<<n<<"!=";
for(i=MAXSIZE-1;i>=0;i--)
cout<<array[i];
cout<<endl;
return 0;
}