언어, 알고리즘 공부/백준

[백준 알고리즘] 2446번 별 찍기 - 9 (Python)

쿠몬e 2020. 3. 17. 22:02

 

<Python>

N = int(input())

for i in reversed(range(1, N+1)):
    print(' ' * (N - i) + "*" * (2 * i-1))
for i in range(2, N+1):
    print(' ' * (N - i) + "*" * (2 * i - 1))

 

▼ 링크

https://www.acmicpc.net/problem/2446

 

2446번: 별 찍기 - 9

첫째 줄부터 2×N-1번째 줄까지 차례대로 별을 출력한다.

www.acmicpc.net

 

반응형