链接:https://www.nowcoder.net/acm/contest/75/A

夫夫有一天对一个数有多少位数感兴趣,但是他又不想跟凡夫俗子一样,
所以他想知道给一个整数n,求n!的在8进制下的位数是多少位。
斯特林公式,log以8为底。刚开始特判都忘了..........

#include<iostream>
#include<cmath>
#include<cstdio>

using namespace std;
double pi=acos(-1);

int main()
{
int t,n;
double ans;
scanf("%d",&t);
while(t–)
{
scanf("%d",&n);
ans=(nlog(n) - n + 0.5log(2npi))/log(8)+1;
if(n<=3) printf("1\n");
else printf("%d\n",(int)ans);
}
return 0;
}