数学公式题罢了
学长
1.斯特灵公式:
2.对数公式(因为以10为底,得到的是10^x,所以最后向下取整加上1);
#include<cstdio>
#include<cmath>
using namespace std;
const double PI=acos(-1);
const double e=exp(double(1));
int str(int n){
return floor(log10(sqrt(2*PI*n))+n*log10(n/e))+1;
}
int main(){
int n;
while(~scanf("%d",&n)){
if(n<=3)printf("1\n");
else
printf("%d\n",str(n));
}
return 0;
}
标签:1129,const,int,double,ZCMU,include,log10
From: https://www.cnblogs.com/hai-zei/p/18166479