题解 | 牛牛的金币
牛牛的金币
https://www.nowcoder.com/practice/35d8e3e569dc49f2a1018d1dc9186998
x1,y1 = map(int, input().split())
x2,y2 = map(int, input().split())
if x2 - x1 > 0 and y2 - y1 == 0:
print('r')
elif x2 - x1 < 0 and y2 - y1 == 0:
print('l')
elif x2 - x1 == 0 and y2 - y1 > 0:
print('u')
else:
print('d')
写得麻烦一点,使用if else进行判断就行

