题解 | #坐标移动#
坐标移动
https://www.nowcoder.com/practice/119bcca3befb405fbe58abe9c532eb29
lst_1 = input().split(";")
x,y=0,0
for item in lst_1:
if not 2 <= len(item) <= 3:
continue
try:
if item[0] in ['A','D','W','S']:
if 0 <= int(item[1:]) <= 99:
if item[0] =='A':
x-=int(item[1:])
if item[0] =='D':
x+=int(item[1:])
if item[0] =='W':
y+=int(item[1:])
if item[0] =='S':
y-=int(item[1:])
except:
continue
print(str(x) + "," + str(y))


