const n=10;
var a:array[1..n] of integer;
i,j,c:integer;
begin
Randomize;
for i:=1 to n do begin
a[i]:=random(51);
write(a[i],' ');
end;
writeln;
for j:=1 to 4 do
begin
c:=a[n];
for i:=n-1 downto 1 do a[i+1]:=a[i];
a[1]:=c;
end;
for i:=1 to n do write(a[i],' ');
writeln;
end.
Пример:
10 7 35 25 26 16 48 41 21 7
48 41 21 7 10 7 35 25 26 16