求助过不了编译的问题
查看原帖
求助过不了编译的问题
1222409
clim楼主2025/1/19 10:30

求助,为什么过不了编译

代码提交之后显示编译错误,在我的vs2022上面是正常运行的,提交答案也没毛病

以下是代码

#include<stdio.h>
#include<iostream>

using namespace std;
const int N=1e6 + 5;
int a[N],b[N],g[N],k[N],number=-2,n,m,t;
void main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i] >> g[i] >> k[i];
	}
	int x, y;
	cin >> x >>  y;
	for (int i = 0; i < n; i++) {
		if ((x>=a[i]&&a[i] + g[i] >= x) && (y>=b[i]&&b[i] + k[i] >= y))
			number = i;
	}
	cout << number+1;
	return;
}

有大佬可以解答一下吗

2025/1/19 10:30
加载中...