tijie
2025-08-07 11:51:09
发布于:江西
6阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,x,y;
cin>>n>>m>>x>>y;
if(y+1<=m) cout<<x<<" "<<y+1<<endl;
else cout<<"NA"<<endl;
if(x+1<=n) cout<<x+1<<" "<<y<<endl;
else cout<<"NA"<<endl;
if(y-1>=1) cout<<x<<" "<<y-1<<endl;
else cout<<"NA"<<endl;
if(x-1>=1) cout<<x-1<<" "<<y<<endl;
else cout<<"NA"<<endl;
return 0;
}
全部评论 2
写一个判断足矣
2025-08-07 来自 江西
1根本不用深度优先搜索
2025-08-07 来自 江西
1
有帮助,赞一个