#include <stdio.h>
#include <stdlib.h>
#define N 1000
int main()
{
int n, i, j;
int a[N][N];
int sum(int a[][N], int n);
while((scanf("%d", &n))== 1&&(n != 0))
{
for(i = 1;i <= n;i ++)
{
for(j = 1;j <= n;j ++)
{
scanf("%d", &a[i][j]);
}
printf("\n");
}
sum(a, n);
}
return 0;
}
int sum(int a[][N], int n)
{
int sum1 = 0, i ,j, sum2 = 0, sum = 0;
if(n == 1)
sum = a[n][n];
else
{
for(i = 1;i <= n;i ++)
for(j = 1;j <= n;j ++)
{
if((i + j)%2 == 0)
sum1 += a[i][j]*sum(a[][N], (n - 1));
else
sum2 += a[i][j]*sum(a[][N], (n - 1))*(-1);
}
}
sum = sum1 + sum2;
printf("%d\n", sum);
return 0;
}
main.c:39: error: syntax error before ']' token
:: === Build finished: 1 errors, 0 warnings ===
下面的一行和上面的差不多!为什么上面的有错误!而下面的没有错误呢!