CR7CR7

copiesTwoD

Jun 13th, 2023
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. int[] src = new int[]{6, 3, 25, 19, 8, 6, 7};
  2. int numCopies = 3;
  3.  
  4. int[][] copies = new int[numCopies][src.length];
  5.  
  6. for (int i = 0; i < numCopies; i++) {
  7.     for (int j = 0; j < src.length; j++) {
  8.         copies[i][j] = src[j];
  9.     }
  10.     System.out.println("SRC" + (i + 1) + ": " + Arrays.toString(copies[i]));
  11. }
  12.  
Add Comment
Please, Sign In to add comment