.


           


p, u, eps : real;

{----------------------------------------------------------------------------------------}

{ - - }

Function

t(eps : real) : integer;

var

k : integer;

begin

k := -1;

repeat

eps := eps*10;

k := k + 1

until eps > 1;

t := k

end;

{----------------------------------------------------------------------------------------}

begin

write(' '); readln(eps);

u := 1; p := 0; n := 1;

repeat

p := p + u;

n := n + 1;

u := -u*(2*n - 3)/(2*n - 1)

until abs(u) < eps;

write(' ', 4*p:1:t(eps), ' ');

writeln(eps:1:t(eps))

end.



3


Program Task3;

uses WinCrt;

var

k : integer;

a, u, z, z1, e, eps : real;

{----------------------------------------------------------------------------------------}

{ - - }

Function t(eps : real) : integer;

var

k : integer;

begin

k := -1;

repeat

eps := eps*10;

k := k + 1

until eps > 1;

t := k

end;

{----------------------------------------------------------------------------------------}

begin

write(' a>1 '); readln(a);

write(' eps '); readln(eps);

u := 1; z := 0;

repeat

u := u*a;

z := z + 1/(1 + u);

z1 := z + 1/(1 + u*a)

until abs(z1 - z) < eps;

write(' ', z1:1:t(eps));

writeln(' ', eps:1:t(eps))

end.



4


 

Program Task4;

uses WinCrt;