Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int arr [][] = new int [4][4];
- arr[0][0] = 89;
- arr[0][1] = 22;
- arr[0][2] = 33;
- arr[0][3] = 44;
- arr[1][0] = 55;
- arr[1][1] = 66;
- arr[1][2] = 77;
- arr[1][3] = 13;
- arr[2][0] = 99;
- arr[2][1] = 10;
- arr[2][2] = 11;
- arr[2][3] = 12;
- arr[3][0] = 13;
- arr[3][1] = 14;
- arr[3][2] = 19;
- arr[3][3] = 16;
- Print(arr);
- highNumber(arr);
- }
- public static void Print(int arr [][]) {
- for (int i = 0; i < arr.length; i++) {
- for (int j = 0; j < arr.length ; j++) {
- System.out.print(arr[i][j] + " ");
- }
- System.out.println();
- }
- }
- public static void highNumber(int arr[][]) {
- int high [] = new int [arr.length];
- for (int i = 0; i < high.length ; i++) {
- high[i] = Integer.MIN_VALUE;
- }
- for (int i = 0; i < arr.length; i++) {
- for (int j = 0; j < arr[i].length ; j++) {
- if(arr[i][j] > high[i]){
- high[i] = arr[i][j];
- }
- }
- System.out.println("The bigest number in row : " + (i + 1) + " is " + high[i] );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement