题解 | #坐标移动#
坐标移动
https://www.nowcoder.com/practice/119bcca3befb405fbe58abe9c532eb29
line=input().split(';') ans=[0,0] for i in line: if len(i)<2 or len(i)>3: continue if i[0] not in 'ADWS': continue if len(i)==3 and i[2].isalpha(): continue if i[0]=='A': ans[0]-=int(i[1:]) if i[0]=='D': ans[0]+=int(i[1:]) if i[0]=='W': ans[1]+=int(i[1:]) if i[0]=='S': ans[1]-=int(i[1:]) print("%d,%d"%(ans[0],ans[1]))