[프로그래머스] 코딩테스트 연습 - 연습문제 Level 1 직사각형 별찍기

uoahy·2021년 9월 28일
0

Solution.java

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();
        }
    }
}

출처: 프로그래머스 코딩 테스트 연습, https://programmers.co.kr/learn/challenges

0개의 댓글