Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Carpet {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.println("Please enter square size: ");
- int size = sc.nextInt();
- for(int m = 0; m < size; m++) {
- for (int k = 0; k < size; k++) {
- for (int i = 0; i < size; i++) {
- for (int j = 0; j < size; j++) {
- System.out.print("*");
- }
- System.out.print(" ");
- }
- System.out.println();
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement