program lab9; uses crt; const n=3; type foil = text ; var i,j,k,l,m:integer; f,g:foil; s:string; p:char; Procedure Input (var H:foil); begin rewrite (h); For i:=1 to n do begin Readln (s); Writeln (h,s); end; close (h); end; Procedure print (var H:foil); begin reset (H); For i:=1 to n do begin readln (h,s); writeln (s) ; end; close (h); end; Procedure Poisk (var Z,Y:foil); begin Reset (z); while not eof(z) do begin read(z,p); if p='+' then inc(m); end; close(z); end; Procedure Work (var Z,Y:foil); begin reset(z); Rewrite (y); if m=0 then while not eof(z) do begin Readln (z,s); writeln (y,s); end; if m>0 then For i:=1 to n do begin Readln (z,s); For j:=1 to length(s) do begin if s[j]<>'+' then if s[j] in ['0'..'9'] then s[j]:='-'; if s[j]='+' then break; end; writeln (y,s); end; close (z); close (y); end; Begin clrscr; assign(f,'c:\Z.txt'); assign(g,'c:\Y.txt'); Input(f); print(f); poisk(f,g); work(f,g); print(g); readkey; end.