提交时间:2024-09-28 15:17:21
运行 ID: 52190
#include<bits/stdc++.h> using namespace std; int main(){ int n,i,j; cin>>n>>i>>j; for(int g=1;g<=n;g++) cout <<"("<<i<<","<<g<<") "; cout<<endl; for(int k=1;k<=n;k++) cout <<"("<<k<<","<<j<<") "; cout<<endl; for(int k=1;k<=n;k++){ for(int g=1;g<=n;g++){ if(k-g==i-j) cout <<"("<<k<<","<<g<<") "; } } cout<<endl; for(int k=n;k>=1;k--){ for(int g=1;g<=n;g++){ if(k+g==i+j) cout <<"("<<k<<","<<g<<") "; } } return 0; }