Есть программа удаления строки матрицы. Как её превратить в программу для вставки строки? Program obn_str; var i, j:integer; obn: array [1..4,1..3] of integer; begin randomize; for i:=1 to 4 do begin for j:=1 to 3 do obn[i,j]:=random(50)+1; end; for i:=1 to 4 do begin for j:=1 to 3 do write(obn[i,j]:3); writeln; end; writeln; for i:=1 to 4-1 do begin for j:=1 to 3 do obn[i,j]:=obn[i+1,j]; end; for i:=4 to 4 do begin for j:=1 to 3 do obn[i,j]:=0; end; for i:=1 to 4 do begin for j:=1 to 3 do write(obn[i,j]:3); writeln; end; end.
Program vst_str; var i, j: integer; vst: array [1..4,1..3] of integer; begin randomize; for i:=1 to 4 do begin for j:=1 to 3 do vst[i,j]:=random(50)+1; end; for i:=1 to 4 do begin for j:=1 to 3 do write(vst[i,j]:3); writeln; end; writeln; for i:=4 downto 2 do begin for j:=1 to 3 do vst[i,j]:=vst[i-1,j]; end; for j:=1 to 3 do vst[1,j]:=0; for i:=1 to 4 do begin for j:=1 to 3 do write(vst[i,j]:3); writeln; end; end.
Program vst_str;
var
i, j: integer;
vst: array [1..4,1..3] of integer;
begin
randomize;
for i:=1 to 4 do begin
for j:=1 to 3 do
vst[i,j]:=random(50)+1;
end;
for i:=1 to 4 do begin
for j:=1 to 3 do
write(vst[i,j]:3);
writeln;
end;
writeln;
for i:=4 downto 2 do begin
for j:=1 to 3 do
vst[i,j]:=vst[i-1,j];
end;
for j:=1 to 3 do
vst[1,j]:=0;
for i:=1 to 4 do begin
for j:=1 to 3 do
write(vst[i,j]:3);
writeln;
end;
end.