๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Algorithm/๋ฐฑ์ค€(BOJ)

[ ํŒŒ์ด์ฌ(python) ] ๋ฐฑ์ค€ 9093 - ๋‹จ์–ด ๋’ค์ง‘๊ธฐ

by YWTechIT 2021. 5. 24.
728x90

๐Ÿ“ ๋ฐฑ์ค€ 9093 - ๋‹จ์–ด ๋’ค์ง‘๊ธฐ

๋ฌธ์ œ: ๋ฐฑ์ค€ 9093 - ๋‹จ์–ด ๋’ค์ง‘๊ธฐ


๐Ÿ’ก ๋‚˜์˜ ํ’€์ด

์ž…๋ ฅ ์ „์ฒด๋ฅผ ๋’ค์ง‘๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๊ณ  ๊ณต๋ฐฑ์„ ๊ธฐ์ค€์œผ๋กœ ๋‚˜๋ˆ„๊ณ  ํ•ด๋‹น ๋‹จ์–ด๋งŒ ๋’ค์ง‘์–ด์„œ ์ถœ๋ ฅํ•˜๋Š” ๋ฌธ์ œ๋‹ค. ๋ฐ˜๋ณต๋ฌธ์„ ์„ ์–ธํ•˜์—ฌ i[::-1]๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•๊ณผ lambda ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋’ค์ง‘๋Š” ๋ฐฉ๋ฒ• ์ด 2๊ฐ€์ง€๋กœ ๋‚˜๋ˆ„์–ด์„œ ํ’€์—ˆ๋‹ค.

import sys
input = sys.stdin.readline

T = int(input())

# ๋ฐ˜๋ณต๋ฌธ ์„ ์–ธ
for _ in range(T):
    result = ' '.join([i[::-1] for i in input().split()])
    print(result)

# ๋žŒ๋‹ค ํ•จ์ˆ˜ ์„ ์–ธ
for _ in range(T):
    print(' '.join(map(lambda x: x[::-1], input().split())))
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€