#include <iostream> #include <vector> #include <time.h> using namespace std; #define NUM 1025 int pb(char *str) { if (*str>='a' &&*str<='z') { return 1; } else if (*str>='A' &&*str<='Z') { return 1; } else if (*str==','|| *str=='.'||*str=='?'||*str=='!'||*str==' ') { return 2; } else return 0; } void reverse(char *str,int len) { char result[NUM]; char chtmp[NUM]; int count=0; int count1=0; int i; for (i=0;i<len;i++) { int ipb=pb((str+i)); if (ipb==1) { chtmp[count++]=str[i]; } else if (2==ipb) { while (count--) { result[count1++]=chtmp[count];