Program lab4;
uses crt;
var ofile,filenew:text;
temp:string;
ch:char;
Procedure replace (var ch:char;var temp:string);
var i:byte;
begin
for i:=1 to length(temp) do
begin
if((temp[i]<='z')and(temp[i]>='a'))or((temp[i]<='Z')and(temp[i]>='A'))
then
begin
temp[i]:=ch;
if ch='z' then
ch:='a'
else ch:=succ(ch);
end;
end;
end;
Begin
clrscr;
writeln('Writing to file "new.txt" ');
assign(ofile,'lab31.pas');
assign(filenew,'new.txt');
reset(ofile);
rewrite(filenew);
ch:='a';
while not eof(ofile) do
begin
readln(ofile,temp);
replace(ch,temp);
writeln(filenew,temp);
end;
close(filenew);
close(ofile);
readln;
End.