if s1 [i] = '^' then
begin
delete (s1, i, 1);
inc (i);
dec (k)
end
else
begin
insert ('-' , s1 , span> i);
inc (i, 2);
inc (k)
end;
if i = k then break;
if s1 [i] = '+' then s1 [i]: = '*'
else s1 [i]: = '+';
inc (i);
end;
end;
{***************************************** *********************}
{ Процедура застосування дистрибутивного закону }
Procedure Disp;
var i , j, k: byte;
sp: string;
Function dis (s: string): string;
var x , l, i, j, p, n: byte;
s1 , s2 , sn: string [80];
begin
i: = pos ('(' , s); j: = pos (')' span> , s); sn: ='';
if (s [j +1] = c1) and (j <> length (s)) then
begin
x: = i;
s1: = copy (s, i +1 , ji - 1);
l: = length (s); p: = l;
for n: = j +2 to l do
if s [n] = c2 then
begin
l: = n;
break
end;
if l = p then s2: = copy (s, j +1 , lj)
else s2: = copy (s, j +1 , lj - 1);
if l = p then delete (s, i, l-i +1)
else delete (s, i, l-i);
repeat
i: = pos (c2, s1);
if i = 0 then
begin