为什么我写的 会程序崩溃
程序代码:#include<stdio.h>
#define N 20
int main()
{
char a[N],i,j=1;
int t[N];
printf("please input the string\n");
gets(a);
for(i=0;i<N;i++)
{
if(a[i]==' ')
t[j++]=i;
else if(i!=0||j!=1)
{
a[t[2]]=a[t[j]+1];
j=1;
}
}
printf("the solved string is\n");
puts(a);
return 0;
}
为什么输入回车后会崩溃 求找错









