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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 uses crt; var n: longint; k: byte; procedure KRZ (c: longint; var kz: byte); var m: set of byte; z: byte; begin if c<0 then c:=c*(-1); if c=0 then kz:=1 else begin m:=[]; kz:=0; while c>=1 do begin if not (c mod 10 in m) then begin inc(kz); m:=m+[c mod 10]; end; c:=c div 10; end; end; end; begin write('n='); readln(n); KRZ (n,k); writeln(k,' различных цифр'); readln; end.
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.