fork(2) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. unsigned long long stirlingLn(double x) {
  6. return floor(log10(sqrt(2*acos(-1.0)*x))+x*log10(x/exp(1)))+1;
  7. }
  8.  
  9. int main() {
  10. cout << stirlingLn(1e9);
  11. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
8565705523