Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int rowsAndCols = Integer.parseInt(console.nextLine());
- int currentNumber = rowsAndCols - 1;
- for (int row = 1; row <= rowsAndCols; row++) {
- for (int col = 1; col <= rowsAndCols; col++) {
- System.out.print(currentNumber);
- }
- currentNumber += 2;
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment