#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
void out(string n)
{
cout << n << ' ';
}
int main()
{
char a[]="what are you doing";//变成"tahw era uoy gniod"
vector <string> iv;
const char * split=" ";
char * p;
p = strtok (a,split);
string s;
while(p!=NULL)
{
s = p;
reverse(s.begin(),s.end());
iv.push_back(s);
p = strtok(NULL,split);
}
s.~string();
for_each(iv.begin(),iv.end(),out);
cout<<endl;
system("pause");
return 0;
}