SOS!
查看原帖
SOS!
1627604
CoderMC楼主2025/1/9 16:16
// #include<bits/stdc++.h>
// using namespace std;
// int n,i,j;
// int a[20][20];
// int main(){
//     cin>>n>>i>>j;
//     for(int A=1;A<=n;A++){
//         for(int B=1;B<=n;B++){
//             cin>>a[A][B];
//         }
//     }
//     cin>>i>>j;
//     for(i;i<=n;i++){
//         for(int B=1;B<=n;B++){
//             cout<<a[i][B];
//         }
//     }
    
    
//     return 0;
// }


#include<bits/stdc++.h>
using namespace std;
int n,i,j;
int main(){
    cin>>n>>i>>j;
    for(int y=1;y<=n;y++){
        printf("(%d,%d) ",i,y);
        cout<<endl;
    }
    for(int x=1;x<=n;x++){
        printf("(%d,%d) ",x,j);
        cout<<endl;
    }
    for(int x=1;x<=n;x++){
        for(int y=1;y<=n;y++){
            if(x-y==i-j){
                printf("(%d %d) ",x,y);
                cout<<endl;
            }
        }
    }
    for(int x=n;x>=1;x--){
        for(int y=n;y>=1;y--){
            if(x+y==i+j){
                printf("(%d %d) ",x,y);
                cout<<endl;
            }
        }
    }
    return 0;
}
2025/1/9 16:16
加载中...