Bài của bạn đây!
Code:
CONST
fi = 'VAO.TXT';
fo = 'RA.TXT';
var
x: char;
alp: string[29];
i: byte;
begin
assign(Input, fi); reset(Input);
assign(Output, fo); rewrite(Output);
alp := 'ABCDEFGHIJKLMNOPQRSTUVWXYZABC';
while not (EOF(Input)) do
begin
read(Input, x);
if x = ' ' then write(Output,' ')
else
for i := 1 to length(alp) - 3 do if x = alp[i] then write(output, alp[i+3]);
end;
writeln(Output);
reset(input);
while not (eof(input)) do
begin
read(Input,x);
write(output,x);
end;
close(Input);
close(output);
end.
Bookmarks