-Code
dic = {"I": 1, "V": 5, "X": 10, "L": 50,
"C": 100, "D": 500, "M": 1000}
for _ in range(int(input())):
s = input()
res = 0
for i in s:
if i in dic:
res += dic[i]
print(res)
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 5292번 Counting Swann’s Coins (0) | 2023.03.25 |
---|---|
[백준/파이썬] 24609번 Overdraft (0) | 2023.03.24 |
[백준/파이썬] 25785번 Easy-to-Pronounce Words (0) | 2023.03.22 |
[백준/파이썬] 5342번 Billing (0) | 2023.03.21 |
[백준/파이썬] 26004번 HI-ARC (0) | 2023.03.20 |