提交时间:2023-05-31 18:33:51

运行 ID: 18859

#include<bits/stdc++.h> using namespace std; int main(){ int n,i,j; cin>>n>>i>>j; for(int j1=1;j1<=n;j1++){ cout<<"("<<i<<","<<j1<<") "; } cout<<endl; for(int i1=1;i1<=n;i1++){ cout<<"("<<i1<<","<<j<<") "; } cout<<endl; for(int i1=1;i1<=n;i1++){ for(int j1=1;j1<=n;j1++){ if(i-j==i1-j1) cout<<"("<<i1<<","<<j1<<") "; } } cout<<endl; for(int i1=n;i1>=1;i1--){ for(int j1=n;j1>=1;j1--){ if(i+j==i1+j1) cout<<"("<<i1<<","<<j1<<") "; } } return 0; }