Răspuns:
Explicație:
program InserareMedii;
var X:array[1..100] of real;
Y:array[1..200] of real;
n, i, m:integer;
begin
write('n='); read(n);
writeln('Introdu ',n,' elemente a tabloului X:');
read(X[1]); Y[1]:=X[1]; m:=1;
for i:=2 to n do
begin
read(X[i]);
m:=m+1; Y[m]:=(X[i-1]+X[i])/2;
m:=m+1; Y[m]:=X[i];
end;
writeln('Tabloul Y cu mediile inserate:');
for i:=1 to m do
write(Y[i], ' ');
writeln;
end.