You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
545 B

7 years ago
7 years ago
  1. import java.math.BigDecimal;
  2. public class LargeDecimals {
  3. public BigDecimal maxOfMins( BigDecimal[][] table ) {
  4. // mom == MaxOfMins
  5. BigDecimal mom = BigDecimal.ZERO;
  6. // mor == MinOfRow
  7. BigDecimal mor;
  8. for (int row = 0; row < table.length;row++) {
  9. mor = table[row][0];
  10. for (int col = 0; col < table[row].length;col++) {
  11. mor = mor.min(table[row][col]);
  12. }
  13. if (row == 0) {
  14. mom = mor;
  15. }
  16. mom = mom.max(mor);
  17. }
  18. return mom;
  19. }
  20. }