编译都没问题,但运行的时候老是出错,这是怎么回事???
#include <stdio.h>int test (int a[], int b[]);
main ( )
{
int a[9];
int b[9];
int i;
int result;
printf("Enter 10 integers for arrays A: ");
for (i=0; i<10; i++)
scanf("%d", &a[i]);
printf("Enter 10 integers for arrays B: ");
for (i=0; i<10; i++)
scanf("%d", &b[i]);
result=test (a, b);
if (result==1)
printf("The tow arrays A and B are equal.\n");
else if (result==0)
printf("The tow arrays A and B are not equal.\n");
}
int test (int a[], int b[])
{
int i;
i=0;
while (i<10)
{
if (a[i]==b[i])
i++;
else
return 0;
}
return 1;
}
高手帮我看看,怎么回事??????????
到底哪里出问题了?????????????