klasscho

Untitled

Nov 28th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. procedure FindMax(const Matrixx: MatrixType; n, iFMax, jFMax, iSMax, jSMax: Integer);
  2. var
  3. FirstMax, SecondMax, i, j: Integer;
  4. begin
  5. FirstMax := Matrixx[0][0];
  6. iFMax := 0;
  7. jFMax := 0;
  8. for i := 0 to n do
  9. begin
  10. for j := 0 to n do
  11. if (Matrixx[i][j] > FirstMax) then
  12. begin
  13. FirstMax := Matrixx[i][j];
  14. iFMax := i;
  15. jFMax := j;
  16. end;
  17. end;
  18. SecondMax := Matrixx[0][0];
  19. iSMax := 0;
  20. jSMax := 0;
  21. for i := 0 to n do
  22. begin
  23. for j := 0 to n do
  24. if ((Matrixx[i][j] > SecondMax) and((i <> iFMax) and (j <> jFMax))) then
  25. begin
  26. FirstMax := Matrixx[i][j];
  27. iSMax := i;
  28. jSMax := j;
  29. end;
  30. end;
  31.  
  32. end;
Advertisement
Add Comment
Please, Sign In to add comment