题解 | #坐标移动#
坐标移动
http://www.nowcoder.com/practice/119bcca3befb405fbe58abe9c532eb29
b = input().strip().split(";")
c=[0,0]
for i in b:
if (i!="") and (i[1::].isdigit()):
if i[0] == "A":
c[0]-=int(i[1::])
elif i[0] =="D":
c[0]+=int(i[1::])
elif i[0] =="W":
c[1]+=int(i[1::])
elif i[0]=="S":
c[1]-=int(i[1::])
else:
continue
print("{0},{1}".format(c[0],c[1]))