0分求调!!!
查看原帖
0分求调!!!
1420059
Peter_0楼主2024/9/24 21:05
#include <stdio.h>

typedef struct zb
{
	int x;
	int y;
}zb;

int main()
{
	int m, n, x, y;
	zb arr[10][10];
	scanf("%d%d%d%d", &m, &n, &x, &y);
	zb* p = (zb*)arr;
	for (int i = 0; i < m; i++)
	{
		for (int j = 0; j < n; j++)
		{
			scanf("%d%d", &(arr[i][j].x), &(arr[i][j].y));
		}
	}
	while (x != 0 && y != 0)
	{
		int tempx = x, tempy = y;
		printf("%d %d\n", x, y);
		x = (arr[tempx - 1][tempy - 1]).x;
		y = (arr[tempx - 1][tempy - 1]).y;
	}
	return 0;
}
2024/9/24 21:05
加载中...