Returns the number of digits of a certain factorial. The most popular method on the Internet is to calculate the logarithm and calculate it hard. The cards are sometimes used, and there are still some clever components. The positive solution may be the method of estimating the factorial in number theory (Source: WIKI): getting the logarithm of this formula can quickly obtain the number of digits. In addition, it is more convenient to make a quick estimation during the competition. [Cpp # include <iostream> # include <cmath> # include <iomanip> using namespace std; const double PI = acos (-1); const double e = exp (1 ); int main () {int testcase; cin> testcase; while (testcase --) {int n; cin> n; double res; if (n = 1 | n = 0) {cout <"1" <endl;} else {res = log10 (sqrt (2 * PI * n )) + n * log10 (n/e); // The string formula cout <setiosflags (ios: fixed) <setprecision (0) <ceil (res) <endl ;}} return 0 ;}