题解 | #迷路的牛牛#
迷路的牛牛
https://www.nowcoder.com/practice/b53be4129b664128b23afc46412593d4
n=int(input()) s=input() l=['N','E','S','W'] idx=0 for i in s: if i=='L': idx-=1 else: idx+=1 i=idx%4 print(l[i])
迷路的牛牛
https://www.nowcoder.com/practice/b53be4129b664128b23afc46412593d4
n=int(input()) s=input() l=['N','E','S','W'] idx=0 for i in s: if i=='L': idx-=1 else: idx+=1 i=idx%4 print(l[i])
相关推荐