// TestString.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream"
#include "string"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char s[]="How are you!!";
int len=strlen(s);
int high=len-1;
for(int m=0;m<high;m++,high--)
{
s[m]^=s[high];
s[high]^=s[m];
s[m]^=s[high];
}
for(int p=0;p<len;p++)
cout<<s[p]<<" ";
cout<<endl;
int start=0,end=0;
for(int i=0;i<len;i++)
{
if(s[i]=='.'||s[i]=='!'||s[i]==':'||s[i]==',')
start+=1;
if(s[i]==' ')
end=i-1;
if(i==len-1)
end=i;
for(int j=start,k=end;j<k;j++,k--)
{
s[j]^=s[k];
s[k]^=s[j];
s[j]^=s[k];
}
start=end+1;
}
for(int p=0;p<len;p++)
cout<<s[p]<<" ";
cin.get();
return 0;
}