发布网友 发布时间:2024-05-10 03:29
共1个回答
热心网友 时间:2024-05-28 22:41
#include<stdio.h>
int main()
{int i,j;
char s[]=" Hello, How are you? ";
printf("s1=\"%s\"",s);
for(i=j=0;s[i];)
{
while(s[i]&&s[i]==' ')i++;
while(s[i]&&(s[j++]=s[i++])!=' ');
}
s[--j]='\0';
printf("\ns2=\"%s\"",s);
return 0;
}