eg. here you are -> are you here
#include <iostream>
#include <string>
#include <vector> //刚好是以空格为分隔的
using namespace std;
int main()
{
string aa = "here you are";
//string aa = " ";
string bb[100];
string str;
int len = aa.size();
int j=0;
for(int i=0; i<len; i++)
{
if(aa[i] != ' ')
{
bb[j]+=aa[i];
}
else
{
j++;
}
}
for( ; j>=0; j--)
{
str += bb[j];
str += ' ';
}
cout << str << endl;
return 0;
}