본문 바로가기
문제풀이/Programmers

[Java] 직사각형 별찍기

by AngieLee 2021. 6. 3.

 

import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i = 0; i < b; i++) {
        	for (int j = 0; j < a; j++) {
				System.out.print("*");
		}
        	System.out.println();
	}
    }
}

 

실행결과