题解 | #坐标移动#
坐标移动
https://www.nowcoder.com/practice/119bcca3befb405fbe58abe9c532eb29
s=input().split(';')
a=[0,0]
for i in s:
try:
if i[0] in ['A','S','W','D']:
step=int(i[1::])
if i[0]=='A':
a[0]-=step
elif i[0]=='S':
a[1]-=step
elif i[0]=='W':
a[1]+=step
elif i[0]=='D':
a[0]+=step
except:
continue
print(str(a[0]) +','+ str(a[1]))