题解 | 坐标移动
坐标移动
https://www.nowcoder.com/practice/119bcca3befb405fbe58abe9c532eb29
import sys
s=input()
arr=s.split(';')
x,y=0,0
for w in arr:
try:
d=int(w[1:])
except Exception:
continue
if w[0]=='A':
x-=d
elif w[0]=='D':
x+=d
elif w[0]=='W':
y+=d
elif w[0]=='S':
y-=d
print(f'{x},{y}')
