为什么数组后面跟了一堆不知道意义的数字,而且后面的赋值程序没有顺利进行

#include
#include
int main()
{
int i,n,j,k,m;
int p[18];
int b[18];
int a[]={7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
int c[]={1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2 };
printf("please input the length of the ID CARD\n");
scanf("%d",&i);
printf("input the id card\n");
for(m=0;m
scanf("%d",&p[m]);
if(i=18)
{
for(m=0;m
printf("%d",p[m]);
}
else if(i=15)
{
for(i=0;i<15;i++)
b[i+2]=p[i];
for(i=0;i<6;i++)
b[i]=p[i];
b[6]=1;
b[7]=9;
for(m=0;m<17;m++)
printf("%d",b[m]);
}
return o;
}

if里面判断有问题,应该用==

局部变量都需要初始化,否则变量内容是随机的一些数据