agencies

[Codeup] 1371 : 마름모 출력하기 본문

Ⅰ. 프로그래밍

[Codeup] 1371 : 마름모 출력하기

agencies 2024. 4. 16. 07:58

 

a=int(input())
for i in range(a):
    for j in range(i,a-1):
        print(" ",end="")
    print("*",end="")

    for k in range(0,i):
        print("  ",end="")


    for j in range(i,i+1):
        print("*",end="")

    
    print()



for i in range(a):

    for k in range(0,i):
        print(" ",end="")
    
    for j in range(i,i+1):
        print("*",end="")

    for t in range(i,a*2-i-2):
        print(" ",end="")

    for j in range(i,i+1):
        print("*",end="")

    print()