链接:http://www.51nod.com/Challenge/Problem.html#!#problemId=1130
特林公式以及本题参考代码:https://blog.csdn.net/qq_41003528/article/details/82840908
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#define pi 3.1415926535
using namespace std;
int main(){
int t;
long long res;
double ans,n;
cin>>t;
while(t--){
cin>>n;
ans = 1;
ans += log10(2.0*pi*n)/2+n*log10(n/exp(1));
res = (long long ) ans;
cout<<res<<endl;
}
return 0;
}