프로그래머스/LEVEL 1

직사각형 별찍기

GenieLove! 2021. 3. 7. 20:49
728x90
반응형

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

Python

a, b = map(int, input().strip().split(' '))
print(("*" * a + "\n") * b)
728x90
반응형

'프로그래머스 > LEVEL 1' 카테고리의 다른 글

x만큼 간격이 있는 n개의 숫자  (0) 2021.03.07
소수 만들기  (0) 2021.03.07
예산  (0) 2021.03.07
비밀지도  (0) 2021.03.07
실패율  (0) 2021.03.07