Advertisement
CR7CR7

matrix09

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