代码如下,我觉得没啥问题
#include<iostream>
using namespace std;
struct ac
{
int x;
int y;
};
ac a[2005][2005];
int main()
{
int m,n,sx,sy;
cin >> m >> n >> sx >> sy;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
cin >> a[i][j].x >> a[i][j].y;
}
}
cout << sx << " " << sy << endl;
for(int i=1;i<=m;i++)
{
for(int j=1;j<=n;j++)
{
if(a[i][j].x != 0 || a[i][j].y != 0)
{
cout << a[i][j].x << " " << a[i][j].y << endl;
}
else
{
return 0;
}
}
}
return 0;
}