Why error? Test #2 WA
#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;
}