medon3

MatrixOfNumbers

Sep 3rd, 2022
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Matrix {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner (System.in);
  6. int number = scanner.nextInt();
  7.  
  8. for (int i = 1; i <= number; i++) {
  9. for (int j = i; j <number + i; j++) {
  10. System.out.print(j + " ");
  11. }
  12. System.out.println();
  13. }
  14.  
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment