xj老师正版题解
2025-10-25 17:24:57
发布于:广东
0阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int dirx[4] = {0, 1, 0, -1};
int diry[4] = {1, 0, -1, 0};
int main () {
int n, m, x, y;
cin >> n >> m >> x >> y;
for (int i = 0;i < 4;i++) {
int nx = x + dirx[i];
int ny = y + diry[i];
if (nx >= 1 && ny >= 1 && nx <= n && ny <= m) {
cout << nx << " " << ny << endl;
}else{
cout << "NA" << endl;
}
}
return 0;
}
这里空空如也







有帮助,赞一个