Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ExerciseMethoods;
- import java.util.Scanner;
- public class O7NxNMatrix {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int number = Integer.parseInt(scanner.nextLine());
- nxnMatrix(number);
- }
- public static void nxnMatrix(int number) {
- for (int i = 0; i < number; i++) {
- for (int j = 0; j < number; j++) {
- System.out.print(number + " ");
- }
- System.out.println(" ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment