Input
Input consists of several lines of integer numbers. The first line contains an integer n, which is the number of cases to be tested, followed by n lines, one integer 1 ≤ n ≤ 10
7 on each line.
输入包含整数的几行。第一行包含一个整数N,要检验的病例数
Output
The output contains the number of digits in the factorial of the integers appearing in the input.
其次是N行,一个整数1≤N≤107各线输出包含在输入中出现的整数的阶乘的位数
#include<iostream>
#define PI 3.1415916
#include<cmath>
using namespace std;
int main()
{
int k,n;
cin >> n;
while ( n--)
{
cin >> k;
int s;
s = (k*log(k) - k + 0.5*log(2 * k*PI)) / log(10);
cout << s+1 << endl;
}
return 0;
}