Guest User

Untitled

a guest
Mar 22nd, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public class Main {
  2. public static void main(String[] args) {
  3. int[][] ar = {{11,12,9,14,60},{200,50,23,19,25},{31,100,33,34,35}};
  4. int max = ar[0][0];
  5. int y = 0;
  6. for (int i = 0; i <ar.length;i++){
  7. for (int k=0;k < ar[i].length;k++){
  8. if (ar[i][k] > max) {
  9. max = ar[i][k];
  10. y = i;
  11. }
  12. }
  13. }
  14. int minInMaxLine = ar[y][0];
  15. for (int i =0;i<ar[y].length;i++){
  16. if (ar[y][i] < minInMaxLine){
  17. minInMaxLine = ar[y][i];
  18. }
  19. }
  20. System.out.println("Max value is : "+max);
  21. System.out.println("Index of max value is : "+y);
  22. System.out.println("Min value in max value's index is : "+minInMaxLine);
  23.  
  24. }
  25. }
Add Comment
Please, Sign In to add comment