Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
54426 | zhangsicun | 同行列对角线的格 | C++ | 通过 | 1 MS | 260 KB | 584 | 2024-10-27 22:22:46 |
#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; }