2 solutions
-
0
#include<bits/stdc++.h> using namespace std; int main() { int n,i,j,t,m; cin>>n>>i>>j; for(t=1;t<=n;t++){ cout<<"("<<i<<","<<t<<") "; } cout<<endl; for(t=1;t<=n;t++){ cout<<"("<<t<<","<<j<<") "; } cout<<endl; int a=i,b=j; while(a>=2&&b>=2){ a--; b--; } while(a<=n&&b<=n){ cout<<"("<<a<<","<<b<<") "; a++; b++; } cout<<endl; a=i,b=j; while(a<n&&b>1){ a++; b--; } while(a>=1&&b<=n){ cout<<"("<<a<<","<<b<<") "; a--; b++; } return 0; }
Information
- ID
- 6778
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 7
- Tags
- (None)
- # Submissions
- 109
- Accepted
- 24
- Uploaded By