思路:制表然后for循环找值
不解:程序直接给我RE/哭泣;求解
以下是我的源码:
dic_={'a':1,'b':2,'c':3,
'd':1,'e':2,'f':3,
'g':1,'h':2,'i':3,
'j':1,'k':2,'l':3,
'm':1,'n':2,'o':3,
'p':1,'q':2,'r':3,'s':4,
't':1,'u':2,'v':3,
'w':1,'x':2,'y':3,'z':4,
' ':1}
re=0
list_=input()
for i in range(len(list_)):
re+=dic_.get(list_[i])
print(re)