Răspuns:
program Fisiere;
var f,g:text;
m1,m2,media:real;
cuv:string;
begin
assign(f,'REZULTAT.TXT');
reset(f);
assign(g,'MEDIA.TXT');
rewrite(g);
while not eof(f) do
begin
readln(f,m1,m2,cuv);
media:=(m1+m2)/2;
writeln(g,media:0:2,' ',cuv);
end;
close(f); close(g);
end.
Explicație: