求助,只a了一个点,找不出错误了(跟讨论区对比了很久)
查看原帖
求助,只a了一个点,找不出错误了(跟讨论区对比了很久)
1144130
dreamaaaaaaaaa楼主2024/3/11 22:25
#include <bits/stdc++.h>
using namespace std;

int a[1010][1010] ;
int main() {
	int n, m, x, y;
	cin >> m >> n >> x >> y;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= 2 * m; j++) {
			cin >> a[i][j];
		}
	}

	do {
		cout << x << " " << y << endl;
		int tx = x, ty = y;
		x = a[tx][2 * ty - 1];
		y = a[tx][2 * ty];

	} while (x && y);
	return 0;
}
2024/3/11 22:25
加载中...