输入一字符串 输出对应相对应的字符串 找不到愿意 啊 在linux上一直显示段错误
#include<stdio.h>#include<string.h>
void main()
{
char *p[10]={"em","cuz","gratz","i","nah","pos","sez","tanx","wuz"};
char *q[10]={"them","because","grateful","I","no","supposed","said","thanks","was"};
char s[]="nah i sez tanx cuz i wuz pos to not cuz i wuz gratz";
char a[10];
int i,j,k=0;
while(1)
{
for(j=k,i=0;s[j]!=' ';j++,k++,i++)
a[i]=s[j];
a[i]='\0';
for(i=0;i<10;i++)
if(strcmp(a,p[i])==1)
printf("%s ",q[i]);
}
} 求帮忙啊