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

StringBuilder sb = new StringBuilder();
for (int i = 0; i < a; i++) {
sb.append("*");
}

for (int i = 0; i < b; i++) {
for (int j = 0; j < 1; j++) {
System.out.print(sb);
}
System.out.println();
}
}
}


for문을 2번 써서 sout으로 * 처리를 하는 방법도 있지만 새롭게(?) 해보고 싶어서 for문을 한번 더 써서 미리 만들어 놓은 *을 출력 하는 방식으로 구성해보았다. 효율은 언급한 방법보다는 떨어지는 거 같다.

BELATED ARTICLES

more