Big Number
In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digits in the factorial of the number.2 10 20
7 19
/*判断一个数是几位数不断除10当被除数为0是就是所求解,此题用到的这是该结论且用到了log相加指数相乘的规则*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
int t;
scanf("%d", &t);
while(t--){
int x;
scanf("%d", &x);
double t;
t = 0;
int ans ;
for(int i = 2; i <= x; i++)
t += log10(i*1.0);
ans = int(t) + 1;
cout << ans << endl;
}
return 0;
}