liyuzhe456 @ 2024-04-03 22:47:46
by RainCQwQ @ 2024-04-03 23:48:32
#include<bits/stdc++.h>
using namespace std;
int n,a[101],s[101];
void mul(int x)
{
int t=0;
for(int i=100;i>=0;i--)
{
a[i]=a[i]*x+t;
t=a[i]/10;
a[i]=a[i]%10;
}
return ;
}
void p()
{
int t=0;
for(int i=100;i>=0;i--)
{
s[i]=s[i]+a[i]+t;
t=s[i]/10;
s[i]=s[i]%10;
}
return ;
}
void pr()
{
int w;
for(int i=0;i<=100;i++)
{
if(s[i]!=0)
{
w=i;
break;
}
}
for(int i=w;i<=100;i++) cout<<s[i];
return ;
}
int main()
{
cin>>n;
s[100]=a[100]=1;
for(int i=2;i<=n;i++)
{
mul(i);
p();
}
pr();
return 0;
}
by liyuzhe456 @ 2024-04-06 18:25:31
@zhangyuyi1218 感谢感谢