fork(2) download
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. double e;
  9. cin >> e;
  10. double a = 1.0, b = 25.0;
  11. double r=0, y=0;
  12. do{
  13. r+=y;
  14. y=1.0/(a+b);
  15. a *= 4;
  16. b *= 5;
  17. }while( y>e );
  18. cout << r << endl;
  19. }
Success #stdin #stdout 0s 3476KB
stdin
0.0000004
stdout
0.0481658