Big Numberproblem DescriptionIn Many applications very large integers numbers are required. Some of these applications is using the keys for secure transmission of data,Encryption, etc. In this problem you is given a number, you had to determine the number of digits in thefactorialof the number.
Inputinput consists of several lines of integer numbers. The first line contains a integer n, which is the number of cases to being tested, followed by n lines, one integer 1≤n≤ 107 on all line.
Outputthe output contains the number of digits in the factorial of the integers appearing in the input.
Sample Input2 10 20
Sample Output7 19Analysis: Seeking n! The number of digits. Notice that the number of bits in n equals (int) LG (n) +1.
1#include <cstdio>2#include <iostream>3#include <cstring>4#include <cmath>5 using namespacestd;6 intMain ()7 {8 intN;9Cin>>N;Ten while(n--) One { A intx; - DoubleAnswer=0; -Cin>>x; the while(x!=1) - { -ANSWER+=LOG10 ((Double) x); -x--; + } -cout<< (int) answer+1<<Endl; + } A return 0; at}
HDU-1018 (Simple math)