SHARE
TWEET

Untitled

a guest Sep 11th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Java2L11 {
  4.     public static void main(String[] args) {
  5.         //      2D array
  6.         //      2 dimension array
  7.         //dmoj.ca
  8.         //ccc18s2
  9.         //  type[][] name = new type[rowsize][colsize];
  10.         int[][] A = new int[2][4];
  11.         Scanner sc = new Scanner(System.in);
  12.         for (int r=0; r<2; r++) {    //One loop control row change
  13.             for (int c=0; c<4; c++) {    //One loop control col change
  14.                 A[r][c] = sc.nextInt();
  15.             }
  16.         }
  17.         for (int r=0; r<2; r++) {    //One loop control row change
  18.             for (int c=0; c<4; c++) {    //One loop control col change
  19.                 System.out.print(A[r][c]+" ");
  20.             }
  21.             System.out.println();   //new line
  22.         }
  23.  
  24.         //ccc16j2
  25.     }
  26.  
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top