Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure FindMax(const Matrixx: MatrixType; n, iFMax, jFMax, iSMax, jSMax: Integer);
- var
- FirstMax, SecondMax, i, j: Integer;
- begin
- FirstMax := Matrixx[0][0];
- iFMax := 0;
- jFMax := 0;
- for i := 0 to n do
- begin
- for j := 0 to n do
- if (Matrixx[i][j] > FirstMax) then
- begin
- FirstMax := Matrixx[i][j];
- iFMax := i;
- jFMax := j;
- end;
- end;
- SecondMax := Matrixx[0][0];
- iSMax := 0;
- jSMax := 0;
- for i := 0 to n do
- begin
- for j := 0 to n do
- if ((Matrixx[i][j] > SecondMax) and((i <> iFMax) and (j <> jFMax))) then
- begin
- FirstMax := Matrixx[i][j];
- iSMax := i;
- jSMax := j;
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment