#include <stdio.h>
int main()
{
int n,i,m,j,k;
char a[20][20];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&m);
for(j=0;j<m;j++)
{
for(k=0;k<m;k++)
{
scanf("%d",&a[j][k]);
}
}
for(j=0;j<m;j++)
{
if((a[j][k]==a[j+1][k])&&(a[j+1][k]==a[j+2][k])&&(a[j+2][k]==a[j+3][k])&&(a[j+3][k]==a[j+4][k]))
{
if(a[j][k]==0)
printf("black win\n");
else if(a[j][k]==1)
printf("white win\n");
else
printf("neither\n");
}
else if((a[j][k]==a[j][k+1])&&(a[j][k+1]==a[j][k+2])&&(a[j][k+2]==a[j][k+3])&&(a[j][k+3]==a[j][k+4]))
{
if(a[j][k]==0)
printf("black win\n");
else if(a[j][k]==1)
printf("white win\n");
else
printf("neither\n");
}
else if((a[j][k]==a[j+1][k+1])&&(a[j+1][k+1]==a[j+2][k+2])&&(a[j+2][k+2]==a[j+3][k+3])&&(a[j+3][k+3]==a[j+4][k+4]))
{
if(a[j][k]==0)
printf("black win\n");
else if(a[j][k]==1)
printf("white win\n");
else
printf("neither\n");
}
else if((a[j][k]==a[j+1][k-1])&&(a[j+1][k-1]==a[j+2][k-2])&&(a[j+2][k-2]==a[j+3][k-3])&&(a[j+3][k-3]==a[j+4][k-4]))
{
if(a[j][k]==0)
printf("black win\n");
else if(a[j][k]==1)
printf("white win\n");
else
printf("neither\n");
}
}
}
return 0;
}
求大神帮我看看错哪了?