Jae-Kyung Cho LLM Developers who was a Robotics engineer

Baekjoon-3568-iSharp

쉬워보이는 문제 대충 풀지말자는 교훈을 얻었다!! 예외처리 똑바로 하자.

def_line = input().split()

for var in def_line[1:]:
    var = var.strip(",").strip(";")
    new_var = ""
    new_type = ""
    for c in var:
        if c not in ['&','*','[',']']:
            new_var += c
        else:
            if c =="[":
                new_type = "]" + new_type
            elif c=="]":
                new_type = "[" + new_type
            else:
                new_type = c + new_type

    print(def_line[0]+new_type+" "+new_var+";")
Comments