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