="justify"> and ((s1 [j +1] = '+') or (j = length (s1)))
then
begin
delete (s1, i, 1);
delete (s1, j - 1,1)
end
else
if (pos ('+' , s ^) = 0) and ((((i = 1 ) or
(s1 [i - 1] = '*')) and (s1 [i - 1] <> '^'))
and ((s1 [j +1] = '*') or (j = length (s1)))) then
begin
delete (s1, i, 1);
delete (s1, j - 1,1)
end
else
begin
s1 [j]: = ')';
s1 [i]: = '(';
end;
i: = pos ('(', s1); j: = pos (')' , s1 );
end;;: = pos ('(' , s1); j: = 0; i <> ; 0 do
begin
if (i = 1) or (s1 [i - 1] <> '^') then
begin
insert ('^' , s1 , span> i);
inc (i)
end
else
begin
delete (s1, i - 1,1);
dec (i)
end;: = pos (')' , s1);
s1 [i]: = '['; s1 [k]: = ']';
i: = pos ('(' , s1);
end;: = s1;
i: = pos ('(', s);
if (i = 1) or (i = 2) then
begin
k: = pos (')' , s);
j: = j + k +1;
if j - 1
begin
if s1 [j] = '*' then s1 [j]: = '+'
else s1 [j]: = '*' <...