1 条题解
-
0
#include <iostream> using namespace std; int main() { int n,x,y; int i,j; cin >> n >> x >> y; for(i=1;i<=n;i++) { cout << "(" << x << "," << i << ") "; //printf("(%d,%d) ",x,i); } cout << endl; for(i=1;i<=n;i++) { cout << "(" << i << "," << y << ") "; //printf("(%d,%d) ",i,y); } cout << endl; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { if(i-j==x-y) cout << "(" << i << "," << j << ") "; //printf("(%d,%d) ",i,j); } } cout <<endl; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { if(i+j==x+y) cout << "(" << j << "," << i << ") "; //printf("(%d,%d) ",j,i); } } return 0; }
- 1
信息
- ID
- 695
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 9
- 标签
- (无)
- 递交数
- 11
- 已通过
- 3
- 上传者