- 同行列对角线的格
过路的
- @ 2025-12-20 17:13:28
#include<bits/stdc++.h> using namespace std; int n,h,l; int main() { cin>>n>>h>>l; for(int i=1; i<=n; i++) { printf("(%d,%d) ",h,i); } cout<<endl; for(int i=1; i<=n; i++) { printf("(%d,%d) ",i,l); } cout<<endl; int k=h-l; for(int i=1; i<=n; i++) { if(i-k>=1 && i-k<=n) { printf("(%d,%d) ",i,i-k); } } cout<<endl; k=h+l; for(int i=1; i<=n; i++) { if(k-i>=1 && k-i<=n) { printf("(%d,%d) ",k-i,i); } } return 0; } $| col | col | col | col | col | | - | - | - | - | - | | content | content | content | content | content | | content | content | content | content | content | | content | content | content | content | content |$
信息
- ID
- 122
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 6
- 标签
- (无)
- 递交数
- 280
- 已通过
- 76
- 上传者