본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 26547번 Square

by 현장 2024. 6. 26.

-Code

for _ in range(int(input())):
    s = input()
    l = len(s)

    if l == 1:
        print(s)
        continue

    print(s)
    for i in range(1, l - 1):
        print(s[i] + " " * (l - 2) + s[-i - 1])
    print(s[::-1])