Advertisement
jwrbg

sad

Mar 5th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. package TechModule;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class p03_MethodsNxNMatrix {
  6.     public static void main(String[] args){
  7.         Scanner scanner = new Scanner(System.in);
  8.         int n = Integer.parseInt(scanner.nextLine());
  9.         matrixN(n);
  10.  
  11.     }
  12.     public static void matrixN(int n){
  13.  
  14.         for (int i = 0; i <n ; i++) {
  15.             for (int j = 0; j <n ; j++) {
  16.                 System.out.print(n+" ");
  17.             }
  18.             System.out.println();
  19.         }
  20.         System.out.println();
  21.     }
  22.  
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement