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

[백준/파이썬] 28637번 Смена стиля

by 현장 2024. 11. 16.

-Code

for _ in range(int(input())):
    s = input()
    res = s[0].lower()

    for w in s[1:]:
        if w.isupper():
            res += "_" + w.lower()
            continue
        res += w

    print(res)