Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Unit601_AV {
- public static void main(String[] args) {
- int[][] att = { {1, 2, 3, 4, 5}, {0, 2, 3, 4, 5}, {0, 0, 3, 4, 5}, {0, 0, 0, 4, 5}, {0, 0, 0, 0, 5} };
- mirrorDiaganol(att);
- //to do: code to print the array.
- for (int row = 0; row<att.length; row++){
- for (int col = 0; col<att[1].length; col++){
- System.out.print(att[att.length][att[1].length]);
- }
- System.out.println();
- }
- }
- public static void mirrorDiaganol(int[][] arr) {
- // to do:
- int x = 1;
- for (int row = 0; row<arr.length; row++){
- for (int col = 0; col<arr[1].length; col++){
- if ((arr[arr.length][arr[1].length]) == 0){
- arr[arr.length][arr[1].length] = x;
- }
- }
- x++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement