В заданном тексте удалить часть текста заключённого в скобки — Pascal(Паскаль)

program del;
uses crt;
var l,i,n,m:integer;
st:string;
begin
clrscr;
readln(st);
i:=length(st);
while i>=1do
if st[i]='(' then
 begin
  n:=i;
  while (st[n]<>')')and(n<=length(st)) do n:=n+1;
  delete(st,i+1,n-i-1);
  i:=i-1;
 end
else i:=i-1;
write(st);
readln
end.

Leave a Comment

+ 15 = 22