|
|
back to boardWhy error? Test #2 WA Posted by kalisha 24 Dec 2008 17:07 #include <stdio.h> //#include <conio.h> int main() { int n; //FILE *f; int i,j,k; int a[101][101]; //f=fopen("1313.txt","r"); //fscanf(f,"%d",&n); scanf("%d",&n); for (i=1;i<=n;i++) { for (j=1;j<=n;j++) { //fscanf(f,"%d",&a[i][j]); scanf("%d",&a[i][j]); } } printf("%d ",a[1][1]); for (i=2;i<=n;i++) { printf("%d ",a[i][1]); if (i>2) { for (j=i-1,k=2;k<=i-1;j--,k++) { printf("%d ",a[j][k]); } } printf("%d ",a[1][i]); } for (i=2;i<n;i++) { printf("%d ",a[n][i]); if (i<n-1) { for (j=n-1,k=i+1;k<=n-1;k++,j--) { printf("%d ",a[j][k]); } } printf("%d ",a[i][n]); } printf("%d ",a[n][n]); //getch(); return 0; } Re: Why error? Test #2 WA Try this test: 1 1 Re: Why error? Test #2 WA Posted by kalisha 31 Dec 2008 01:49 +1 Re: Why error? Test #2 WA I did not consider it first. Really helped! |
|
|