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.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
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