how are you

#include<stdio.h>
  int main(){
  char sentence[100];
  int len=0,j,wordlen=0;
  gets(sentence);
  while(sentence[len]) len++;
  for(j=len-1;j>=0;j--){
  if(sentence[j]>='a'&&sentence[j]<='z'||sentence[j]>='A'&&sentence[j]<='Z')
  {
  wordlen++;
  }
  else if(wordlen>0){
  printf("%*.*s",wordlen,wordlen,&sentence[j+1]);
  printf("%c",sentence[j]);
  wordlen=0;
  }
  else
  rintf("%c",sentence[j]);
  }
  if(wordlen>0)
  printf("%*.*s",wordlen,wordlen,sentence);
  return 0;
posted @ 2015-04-25 23:27  张德瑞  阅读(104)  评论(0编辑  收藏  举报