为什么赋值-1时赋值不上去还是0
#include<stdio.h>#include<stdlib.h>
#include<time.h>
#define hang 10
#define lie 10
#define lei 10
int arr[hang][lie];
void fun1()
{
int i, j,m,n,sum;
for (i = 0; i < hang; i++)
{
for (j = 0; j < lie ; j++)
{
arr[i][j] = 0;
}
}
srand((unsigned int)time(NULL));
for (sum = 0; sum < 10; sum++)
{
m = rand() % (hang );
n = rand() % (lie);
if (arr[m][n] != 0)
arr[m][n] = -1;
}
}
void main()
{
void fun1();
int i, j;
for (i = 0; i < hang; i++)
{
for (j = 0; j < lie ; j++)
{
printf("%d ", arr[i][j]);
}
printf("\n");
}
}