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

[백준/파이썬] 19813번 Dates

by 현장 2024. 9. 20.

-Code

for _ in range(int(input())):
    line = input()
    if '.' in line:
        d, m, y = map(int, line.split('.'))
        print(f"{d:02}.{m:02}.{y:04} {m:02}/{d:02}/{y:04}")
    else:
        m, d, y = map(int, line.split('/'))
        print(f"{d:02}.{m:02}.{y:04} {m:02}/{d:02}/{y:04}")