题解 | #坐标移动#
坐标移动
https://www.nowcoder.com/practice/119bcca3befb405fbe58abe9c532eb29
nums=list(map(str,input().split(";"))) m,n=0,0 # print(nums) for num in nums: if (2<=len(num)<=3) and num[1:3].isdigit(): if num[0]=="A": m-=int(num[1:]) if num[0]=="D": m+=int(num[1:]) if num[0]=="W": n+=int(num[1:]) if num[0]=="S": n-=int(num[1:]) print(str(m)+","+str(n))