单词逆置
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 char s1[1000],s2[100]; 6 int c,k,i,l; 7 gets(s1); 8 l=strlen(s1); 9 s1[l]=' '; 10 c=0;k=0; 11 for(i=0;i<=l;i++) 12 { 13 if(s1[i]!=' ') 14 { 15 s2[k++]=s1[i]; 16 c=0; 17 } 18 if(s1[i]==' ') 19 { 20 s2[k]='\0'; 21 c++; 22 if(c==1) 23 strrev(s2); 24 printf("%s",s2); 25 k=0; 26 if(i!=l) 27 printf(" "); 28 } 29 } 30 printf("\n"); 31 return 0; 32 } 33 i love you!!! 34 i ovel !!!ouy