void StrOL(void)
{
int n1;
int len;
char *p1,*p2;
char t1[80],t2[80];
for(n1=0;n1<maxline;n1++)
{
len=strlen(xx[n1]);
t1[0]=t2[0]='\0';
p1=&xx[n1][len-1];
p2=&xx[n1][len-1];
while(1)
{
while(isalpha(*p1)==0)
{
p1--;
if(p1<xx[n1])
break;
}
if(p1<xx[n1])
break;
p2=p1;
while(isalpha(*p1))
p1--;
memcpy(t2,p1+1,p2-p1);
t2[p2-p1]='\0';
strcat(t1,t2);
strcat(t1," ");
if(p1<xx[n1])
break;
}
strcpy(xx[n1],t1);
}
}
看看好了没有
{
int n1;
int len;
char *p1,*p2;
char t1[80],t2[80];
for(n1=0;n1<maxline;n1++)
{
len=strlen(xx[n1]);
t1[0]=t2[0]='\0';
p1=&xx[n1][len-1];
p2=&xx[n1][len-1];
while(1)
{
while(isalpha(*p1)==0)
{
p1--;
if(p1<xx[n1])
break;
}
if(p1<xx[n1])
break;
p2=p1;
while(isalpha(*p1))
p1--;
memcpy(t2,p1+1,p2-p1);
t2[p2-p1]='\0';
strcat(t1,t2);
strcat(t1," ");
if(p1<xx[n1])
break;
}
strcpy(xx[n1],t1);
}
}
看看好了没有