.


           


ym := (k1 - 1)/(k1 + 1);

end;

if

abs(ym - 1) < eps

then

begin

write(' abs(1 - ',ym:6:t(eps),') <', eps:1:t(eps));

writeln(' ')

end

else

begin

write(' abs(1-', ym:6:t(eps),') <', eps:1:t(eps));

writeln(' ')

end

end.

5

Program Task5;

uses

WinCrt;

var

n : longint;

u, u1, eps : real;

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

Function

s(k : integer) : longint;

var

i, z : longint;

begin

z := 1;

for

i := 1 to k do z := 3*z;

s := z

end;

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

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

writeln(' eps');

write(' '); readln(eps);

u := 0;

n := 1;

repeat

u := u + 1/(s(n) + 1);

n := n + 1;

u1 := u + 1/(s(n) + 1);

until

abs(u1 - u) < eps;

writeln(' ', u1:6:t(eps));

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

end.