60分求助
查看原帖
60分求助
1340578
piyuhan666楼主2024/7/23 17:22
#include<bits/stdc++.h>
using namespace std;
int x[10][10],y[10][10],p;
int main(){
	cin>>p>>x[0][0]>>y[0][0]>>x[1][1]>>y[1][1];
	if(x[0]==x[1]||y[0]==x[1]){
		cout<<"Yes";
	}//车 
	else if(x[0]+2==x[1]&&y[0]+1==y[1]||
	x[0]+2==x[1]&&y[0]-1==y[1]||
	x[0]-2==x[1]&&y[0]+1==y[1]||
	x[0]-2==x[1]&&y[0]-1==y[1]||
	x[0]+1==x[1]&&y[0]+2==y[1]||
	x[0]+1==x[1]&&y[0]-2==y[1]||
	x[0]-1==x[1]&&y[0]+2==y[1]||
	x[0]-1==x[1]&&y[0]-2==y[1]){
		cout<<"Yes";
	}//马 
	else if(x[0]+2==x[1]&&y[0]+2==y[1]||
	x[0]+2==x[1]&&y[0]-2==y[1]||
	x[0]-2==x[1]&&y[0]+2==y[1]||
	x[0]-2==x[1]&&y[0]-2==y[1]){
		cout<<"Yes";
	}//象 
	else{
		cout<<"No";
	}
	return 0;
} ```
2024/7/23 17:22
加载中...