???? ????????????? ???????? ????? ??????????? ????????? ????????
??, 02/12/2011 - 20:46 ? tech
???? ????????
????????? ??????????? if-else
????????? ???????
????? ? ???????
??????:
????: ????????????? ??????? ?? n ????? ? m ????????.
?????: ???????? ?? ?????????? ????????? ????????.

???????? ??????? ??????:
????????? ???????? ??????? 1.

??????????? ?????? ???????. ?????????? ??????? ??????? ??????? ????????? ? ?????????? ???????.
????? ???????????? ???????? ? ?????????? ???????.
????????? ???????? ??????? 2.

????? ?????????? ??????? ??????? ??????? ? ????????????, ??? ?? ???????????? (???????? ? ??????????).
????? ?????????? ??????? ??????? ???????. ???????? ??? ? ?????????? ??????????. ???? ??????, ???????? ???????? ??????????. ? ?.?.
????????? ?? ????? ???????:
const
n = 4; m = 5;

var
matrix: array[1..n,1..m] of integer;
max, min, i, j: integer;

begin

randomize;
for i := 1 to n do begin
for j := 1 to m do begin
matrix[i,j] := random(100);
write(matrix[i,j]:3);
end;
writeln;
end;

max := 0; {???????? ????? ?????????}
for j := 1 to m do begin {???????? ????????}
min := matrix[1,j]; {????????????, ??? ?????? ? ??????? ?????????}
for i := 2 to n do {????????????? ??????? ?????????}
if matrix[i,j] < min then
min := matrix[i,j]; {?????? ????????}
if min > max then
max := min {?????? ?????????}
end;

writeln(max);