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