fork(1) download
  1. program project1;
  2. uses math;
  3. var y, s, n, e:real;
  4. begin
  5. y:=1;
  6. s:=1;
  7. n:=1;
  8. e:=0.0001;
  9. while y>e do begin
  10. y:=1/power(2,n);
  11. s:=s+y;
  12. n:=n+1;
  13. end;
  14. writeln(s:7:5);
  15. readln;
  16. end.
Success #stdin #stdout 0s 5272KB
stdin
Standard input is empty
stdout
 1.9999