#include "stdafx.h"
#include "iostream"
#include "vector"
#include "string"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
string str;
vector<string>vec;
char a[1];
while (cin >> str)
{
a[0]=cin.get();
if (a[0] == '\n')
{
vec.push_back(str);
break;
}
else
{
vec.push_back(str);
}
}
for (int i = vec.size(); i>0; i--)
{
cout << vec[i - 1] << " ";
}
getchar();
getchar();
return 0;
}
转载于:https://my.oschina.net/u/1446208/blog/464887