Algorithm/boj

[파이썬] 7583 Jumbled Words

takeU 2022. 6. 20. 17:23
반응형
while True:
    s = input().split()
    if s == ['#']:
        break
    li = list(map(lambda x: x[0] if len(x) == 1 else x[0] + x[1:-1][::-1] + x[-1], s))
    print(' '.join(li))