1.可以定义大写MAX做数组的长度
#include <bits/stdc++.h>
using namespace std;
const int MAX = 100005;
int a[MAX], b[MAX], g[MAX], k[MAX];
int main(){
int n,x,y; cin >> n;
for (int i = 1; i <= n; i++) {
cin>> a[i] >>b[i] >> g[i] >> k[i];
}
cin >> x >> y;
for (int i = n; i >= 1; i--) {
if (x >= a[i] && y >= b[i] && x <= a[i] + g[i] && y <= b[i] + k[i]) {
cout << i;
return 0;
}
}
cout << -1;
return 0;
}