Răspuns:
program substituieMAprinTA;
var s:string;
i:integer;
begin
write('introdu sirul de caractere: '); read(s);
for i:=1 to length(s)-1 do
if (s[i]='M') and (s[i+1]='A') then s[i]:='T';
writeln('Sirul modificat: ',s);
end.
Explicație:
program radiazaTO;
var s:string;
i:integer;
begin
write('introdu sirul de caractere: '); read(s);
i:=1;
while i<length(s) do
begin
if (s[i]='T')and(s[i+1]='O') then delete(s,i,2)
else i:=i+1;
end;
writeln('Sirul modificat: ',s);
end.