BOJ - 13015 - 별 찍기 - 23
Updated:
def drawFirstLastLine(N):
for i in range(4 * N - 3):
if N <= i <= 3 * N - 4:print(" ", end="")
else: print("*", end="")
print("")
def drawMiddleLine(N):
drawNull(N-1)
drawStar(1)
drawNull(N-2)
drawStar(1)
drawNull(N-2)
drawStar(1)
print("")
def drawStar(N): print("*"*N, end="")
def drawNull(N): print(" "*N, end="")
def solution():
N = int(input())
drawFirstLastLine(N)
for i in range(1, N-1):
drawNull(i)
drawStar(1)
drawNull(N-2)
drawStar(1)
drawNull((2 * N) - (2 * i) - 3)
drawStar(1)
drawNull(N-2)
drawStar(1)
print("")
drawMiddleLine(N)
for i in range(N-2, 0, -1):
drawNull(i)
drawStar(1)
drawNull(N - 2)
drawStar(1)
drawNull((2 * N) - (2 * i) - 3)
drawStar(1)
drawNull(N - 2)
drawStar(1)
print("")
drawFirstLastLine(N)
solution()
https://www.acmicpc.net/problem/13015
Leave a comment