import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
static int n;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
n = Integer.parseInt(br.readLine());
String board[] = new String[n];
board[0] = " * ";
board[1] = " * * ";
board[2] = "*****";
for (int k = 1; 3 * (int)Math.pow(2, k) <= n; ++k) {
DC(k, board);
}
for (int i = 0; i < n; ++i) {
System.out.println(board[i]);
}
}
private static void DC(int k, String board[]) {
int bottom = 3 * (int)Math.pow(2, k);
int middle = bottom / 2;
for (int i = middle; i < bottom; ++i) {
board[i] = board[i - middle] + " " + board[i -middle];
}
String temp = "";
while (temp.length() < middle) {
temp += " ";
}
for (int i = 0; i < middle; ++i) {
board[i] = temp + board[i] + temp;
}
}
}
'[Solved] > BOJ' 카테고리의 다른 글
[백준 14600] 샤워실 바닥 깔기 (Small) (0) | 2023.05.16 |
---|---|
[백준 2630] 색종이 만들기 (0) | 2023.05.14 |
[백준 1074] Z (0) | 2023.05.12 |
[백준 17136] 외판원 순회 (0) | 2023.05.07 |
[백준 16987] 계란으로 계란치기 (0) | 2023.05.06 |