//Pascal
var
A: array [1 .. 5, 1 .. 4] of integer;
V: array [1 .. 20] of integer;
i, j, z: byte;
SUM1, SUM2, SUM3, MIN: integer;
begin
randomize;
writeln('***Сгенерированный массив***');
SUM1 := 0; SUM2 := 0; SUM3 := 0;
for i := 1 to 5 do
begin
for j := 1 to 4 do
begin
A[i, j] := random(30);
if ((A[i, j] >= 0) and (A[i, j] <= 5)) then SUM1 := SUM1 + A[i, j];<br> if ((A[i, j] >= 5) and (A[i, j] <= 15)) then SUM2 := SUM2 + A[i, j];<br> write(A[i, j]:6)
end;
writeln;
end;
writeln('Сумма элементов [0 5] = ', SUM1);
writeln('Сумма элементов [5 15] = ', SUM2);
MIN := A[3, 1];
for j := 1 to 4 do if A[3, j] < MIN then MIN := A[3, j];
writeln('Минимальный элемент в третьей строке = ', MIN);
writeln('***Вектор***');
j := 1;
z := 0;
while (z < 20) do
begin
for i := 1 to 5 do
begin
z := z + 1;
V[z] := A[i, j];
end;
j := j + 1;
end;
for i := 1 to 20 do writeln(V[i]:6);
for i := 20 downto 10 do SUM3 := SUM3 + V[i];
writeln('Сумма последних 10-ти элементов = ', SUM3);
readln;
end.