program massiv ;
uses crt;
type mas=array[1..1000] of integer;
var i,n,k,r: integer;
m:mas;
begin writeln ('введи число') ;
readln (n);
randomize;
for i:=1 to n do
begin
m[i]:=random(45)+1;
write(m[i], ' ');
end;
writeln;
write('введи номер эл-та '); readln (k) ;
write('введи эл-т '); readln (r) ;
writeln;
for i:=n+1 downto 1 do
if i>k then m[i]:=m[i-1];
m[k]:=r;
for i:=1 to n+1 do
write(m[i], ' ');
end.
uses crt;
type mas=array[1..1000] of integer;
var i,n,k,r: integer;
m:mas;
begin writeln ('введи число') ;
readln (n);
randomize;
for i:=1 to n do
begin
m[i]:=random(45)+1;
write(m[i], ' ');
end;
writeln;
write('введи номер эл-та '); readln (k) ;
write('введи эл-т '); readln (r) ;
writeln;
for i:=n+1 downto 1 do
if i>k then m[i]:=m[i-1];
m[k]:=r;
for i:=1 to n+1 do
write(m[i], ' ');
end.