还有这个公式?1*2*3*4的位数为log10(1)+log10(2)+log10(3)+log10(4),转化为整形再加上 1
#include <bits\stdc++.h>
using namespace std;
int main()
{
double n;
scanf("%lf",&n);
double ans=0;
for(int i=1;i<=n;i++)
ans+=log10(i);
int k=ans;
k++;
cout<<k<<endl;
return 0;
}