fork download
  1. var
  2. count, d: integer = 0;
  3. prev, current: double = 1.0;
  4. begin
  5. d := 2;
  6. //
  7. repeat
  8. //
  9. inc(count);
  10. d := d * (count + 1) * 2;
  11. //
  12. prev := current;
  13. current := count * count * (count + 4) / d;
  14. //
  15. until (prev - current <= 0.001);
  16. //
  17. writeln(current);
  18. writeln(count);
  19. end.
  20.  
Success #stdin #stdout 0.01s 4112KB
stdin
Standard input is empty
stdout
 5.221896701388889e-05
7