-Code
s = input()
uIndex = s.find("U")
fIndex = s.rfind("F")
res = ""
for i in range(len(s)):
if i < uIndex or i > fIndex:
res += "-"
elif i == uIndex or i == fIndex:
res += s[i]
else:
res += "C"
print(res)
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 24569번 Fergusonball Ratings (0) | 2023.03.31 |
---|---|
[백준/파이썬] 24603번 Scaling Recipe (0) | 2023.03.30 |
[백준/파이썬] 26941번 Pyramidbygge (0) | 2023.03.28 |
[백준/파이썬] 27918번 탁구 경기 (0) | 2023.03.27 |
[백준/파이썬] 27890번 특별한 작은 분수 (0) | 2023.03.26 |