program raf105;
var
s: string;
pos1,pos2: integer;
begin
writeln('Введите строку: ');
readln(s);
repeat
pos1:= pos('(',s);
pos2:= pos(')',s);
if (pos1<>0) and (pos2<>0)
then delete(s,pos1,pos2-pos1+1);
until (pos1=0) or (pos2=0);
writeln(s);
end.
program raf105;
var
s: string;
pos1,pos2: integer;
begin
writeln('Введите строку: ');
readln(s);
repeat
pos1:= pos('(',s);
pos2:= pos(')',s);
if (pos1<>0) and (pos2<>0)
then delete(s,pos1,pos2-pos1+1);
until (pos1=0) or (pos2=0);
writeln(s);
end.
PascalABC 3.4.2