#include<iostream.h>
void main()
{
int result[10000];
int p=0,i;
int ininum=0;
char ini[10];
int temp;
memset(result,0,sizeof(p)*10000);
cout<<"please input the initial number"<<endl;
cin>>ini;
for( i=0,p=strlen(ini)-1;i<strlen(ini);p--,i++)
{
result[p]=ini[i]-'0';
ininum=ininum*10+result[p];
}
ininum--;
p=strlen(ini)-1;
int jin,high,max;
max=p;
for(;ininum>0;ininum--)
{
for(i=0;i<=p;i++)
result[i]*=ininum;
for(i=p,high=i;i>=0;i--,high=i)
{
while(result[high]>9)
{
jin=result[high]/10;
result[high]=result[high]%10;
high++;
result[high]+=jin;
if(high>max)
max=high;
}
}
p=max;
}
for(int j=max;j>=0;j--)
cout<<result[j];
}