y1441206 @ 2023-02-20 17:13:23
#include<bits/stdc++.h>
using namespace std;
int n,m;
int a[10000];
int main()
{
cin>>n;
double s=0.0;
for(int i=2;i<=n;i++){
s += 1.0*log10(i);
}
m = (int)s+1;
a[1]=1;
for(int i=2;i<=m;i++) a[i]=0;
int g=0;
for(int k=2;k<=n;k++){
for(int j=1;j<=m;j++){
int t = a[j]*k+g;
a[j] = t%10;
g = t/10;
}
}
for(int i=m;i>=1;i--){
cout<<a[i];
}
return 0;
}
by y1441206 @ 2023-02-20 17:30:52
看错了题目意思,不好意思