PAT乙级1009.说反话

#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{char s[82];
 gets(s+1);
 s[0]=' ';
 for(int i=strlen(s);i>=0;i--)
 {  if(s[i]==' ')
    {  printf("%s",s+i+1);
    s[i]='\0';
    if(i==0)
    printf("%c",'\n');
     else
    printf("%c",' ');
 }
    else
      continue;
 }}
 

posted @ 2018-01-29 18:48  kong孔  Views(53)  Comments(0)    收藏  举报