题解 | #坐标移动#
坐标移动
https://www.nowcoder.com/practice/119bcca3befb405fbe58abe9c532eb29
n =input().split(';')
hashmap={'A':0,'W':0,'D':0,'S':0}
for i in n :
key,value=i[0:1:1],i[1::]
if value.isdigit():
hashmap[key]=hashmap[key]+int(value)
result ='%s,%s'%(hashmap['D']-hashmap['A'],hashmap['W']-hashmap['S'])
print(result)
查看8道真题和解析