N!的位数
作者:互联网
斯特林公式(Stirling's approximation)
求位数
代码
#include<iostream> #include<cmath> using namespace std; #define pi 3.1415926535 #define e 2.718281828459 int main() { int n; cin >> n; printf("%d",(int)(1 + 0.5*log10(2 * pi*n) + n*log10(n / e))); }
标签:pi,int,位数,include,log10,define 来源: https://www.cnblogs.com/Jason66661010/p/13111743.html