program zad1;
uses crt;
const n=5;
var
tab:array [1..n] of integer;
tab1:array[1..n] of integer;
i,licznik,suma:integer;
begin
randomize;
for i:=1 to n do
begin
tab[i]:=random(10);
writeln(tab[i]);
end;
for i:=2 to n-1 do tab1[i]:=tab[i-1]+tab[i+1];
tab1[1]:=tab[ 2];
tab1[n]:=tab[n-1];
writeln('nowa tablica');
for i:=1 to n do
writeln(tab1[i]);
readln;
end.