Problem : 1018 ( Big Number ) Judge Status : Accepted
RunId : 5383214 Language : G++ Author : billforum
Code Render Status : Rendered By HDOJ G++ Code Render Version 0.01 Beta
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n, num;
cin >> n;
for(int i=0;i<n; i++)
{
cin >> num;
if(num == 1)
{
cout <<"1"<< endl;
continue;
}
double sum = 0.0;
for(int j=1; j<=num; j++)
{
sum+=log10(double(j));
}
cout <<(int)sum+1<< endl;
}
return 0;
}