const n=6; num=100; var arr:array[1..n] of integer; m,i,j:integer; begin Writeln('zapolnite massiv: '); for i:=1 to n-1 do Read(arr[i]); Write('pozitia v massive: '); Read(m); if (arr[m] mod 2)=0 then begin for i:=n-1 downto m+1 do arr[i+1]:=arr[i]; arr[m+1]:=num end else begin for i:=n-1 downto m do arr[i+1]:=arr[i]; arr[m]:=num end; Write(' noviy massiw=: '); for i:=1 to n do Write(arr[i]:5); writeln; readln; end.
num=100;
var arr:array[1..n] of integer;
m,i,j:integer;
begin
Writeln('zapolnite massiv: ');
for i:=1 to n-1 do
Read(arr[i]);
Write('pozitia v massive: ');
Read(m);
if (arr[m] mod 2)=0
then
begin
for i:=n-1 downto m+1 do
arr[i+1]:=arr[i];
arr[m+1]:=num end
else
begin for i:=n-1 downto m do
arr[i+1]:=arr[i]; arr[m]:=num
end;
Write(' noviy massiw=: ');
for i:=1 to n do
Write(arr[i]:5);
writeln;
readln;
end.