【逃兵】【python】罗马数字转阿拉伯数字
本帖最后由 逃兵 于 2021-6-10 16:16 编辑def romanToInt(s):
f = 0
number_dict={'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000}
temp = s
lst = for i in temp]+
for i in range(len(lst)-1):
if lst < lst:
f-=lst
else:
f+=lst
return f
页:
[1]