Program N70231806_1;
var a:array[ 1 .. 10 ] of shortint;
i:byte;
t:shortint;
begin
randomize;
writeln('Исходный массив: ');
for i := 1 to 10 do
begin
a[ i ] := random(21) - 10;
write(a[ i ]:4)
end;
writeln;
t := a[ 10 ];
for i := 10 downto 2 do
a[ i ] := a[ i - 1 ];
a[ 1 ] := t;
writeln('Результат: ');
for i := 1 to 10 do
write(a[ i ]:4);
readln
end.
2)
program N70231806_2;
var a:array[ 1 .. 12 ] of shortint;
i, j:byte;
t:shortint;
begin
randomize;
writeln('Исходный массив: ');
for i := 1 to 12 do
begin
a[ i ] := random(25) - 10;
write(a[ i ]:4)
end;
writeln;
for j := 1 to 4 do
begin
t := a[ 12 ];
for i := 12 downto 2 do
a[ i ] := a[ i - 1 ];
a[ 1 ] := t
end;
writeln('Результат: ');
for i := 1 to 12 do
write(a[ i ]:4);
readln
end.