解题思路:坐标存列表。然后遍历
注意事项:
参考代码:
n=int(input().strip())
myList=[]
for _ in range(n):
a,b,c,d=map(int,input().strip().split())
myList.append((a,b,c,d))
nx,ny=map(int,input().strip().split())
temp=()
for x1,y1,x2,y2 in myList:
# print(myList.index((x1,y1,x2,y2))+1)
if x1<=nx<=x1+x2 and y1<=ny<=y1+y2:
temp=(x1,y1,x2,y2)
if len(temp)==0:
print(-1)
else:
print(myList.index(temp)+1)
0.0分
0 人评分