fork download
  1. #include <iostream>
  2. #include <math.h>
  3. #define LOW_LOG_10 13
  4. #define HIGH_LOG_10 1000
  5. using namespace std;
  6.  
  7. int main() {
  8. long double log_sum=0;
  9. unsigned long k,count=0;
  10. for(k=1;k>0;k++)
  11. {
  12. log_sum+=log10(k);
  13. if(log_sum>LOW_LOG_10 && log_sum<HIGH_LOG_10)
  14. count++;
  15. if(log_sum>=HIGH_LOG_10)
  16. break;
  17. }
  18. cout<<count;
  19. return 0;
  20. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
434