10分求助!!!
查看原帖
10分求助!!!
1622400
LzraSirrr楼主2024/12/24 17:53
#include<bits/stdc++.h>

using namespace std;

const int maxn = 1005;

struct Location{
	int content[maxn];
}a[maxn];

int m,n,Sx,Sy;


int main(){
	cin >> m >> n >> Sx >> Sy;
	for(int i = 1; i <= n;++i){
		for(int j = 1;j <= 2*m;++j){
			cin >> a[i].content[j];
		}
	} 
	int Qx,Qy;
	cout << Sx << " " << Sy << " " << endl;
	for(int i = 0;i >= 0;i++){
			Qx = a[Sx].content[2*Sy - 1];
			Qy = a[Sx].content[2*Sy];
			if(Qx == 0 && Qy == 0 ){
				break;
			} else{			
				cout << Qx << " " << Qy << " " << endl;	
		 		Sx = Qx;
				Sy = Qy;
			}

		}
	return 0;
}
2024/12/24 17:53
加载中...