Var ar:array[1..10] of integer;
i,c:integer;
begin
randomize;
writeln('First array:');
for i:=1 to 10 do
begin;
ar[i]:=random(30);
write(ar[i]:4);
end;
for i:=2 to 10 do
ar[i-1]:=ar[i];
c:=ar[1];
ar[1]:=ar[9];
ar[9]:=c;
writeln;
writeln('Final array:');
for i:=1 to 9 do
write(ar[i]:4);
end.