fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. double stirling(double x) {
  6. return sqrt(2*acos(-1.0)*x)*pow(x/exp(1.0),x);
  7. }
  8.  
  9. unsigned long fd (unsigned long x) {
  10. return floor(log(stirling(x))) + 1;
  11. }
  12.  
  13. int main() {
  14. cout << fd(10);
  15. return 0;
  16. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
16