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