You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
714 B

2 years ago
#include<bits/stdc++.h>
using namespace std;
void show(int n,int i,int j) {
int a,b,c;
b=i;
c=j;
for(a=1; a<=n; a++) { //<2F><><EFBFBD><EFBFBD>ͬһ<CDAC><D2BB><EFBFBD>ϵ<EFBFBD>λ<EFBFBD><CEBB>
printf("(%d,%d)",i,a);
}
printf("\n");
for(a=1; a<=n; a++) { //<2F><><EFBFBD><EFBFBD>ͬһ<CDAC><D2BB><EFBFBD>ϵ<EFBFBD>λ<EFBFBD><CEBB>
printf("(%d,%d)",a,j);
}
printf("\n");
while(i>0&&j>0) { //<2F><><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>¶Խ<C2B6><D4BD><EFBFBD><EFBFBD>ϵĸ<CFB5><C4B8>ӵ<EFBFBD>λ<EFBFBD><CEBB>
i--;
j--;
}
i++;
j++;
while(i<=n&&j<=n) {
printf("(%d,%d)",i,j);
i++;
j++;
}
printf("\n");
i=b;
j=c;
while(i<=n&&j>0) { //<2F><><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD>϶Խ<CFB6><D4BD><EFBFBD><EFBFBD>ϵĸ<CFB5><C4B8>ӵ<EFBFBD>λ<EFBFBD><CEBB>
i++;
j--;
}
i--;
j++;
while(i<=n&&j<=n&&i>0&&j>0) {
printf("(%d,%d)",i,j);
i--;
j++;
}
}
int main() {
int n,i,j;
scanf("%d %d %d",&n,&i,&j);
if(1<=i&&i<=n&&1<=j&&j<=n)
show(n,i,j);
return 0;
}