1009

#include
#include
#include
#include


using namespace std;

int main()
{
    stack string_out;
    string tmp;

    if (getline(cin, tmp))              //getline读取一行的输入!
    {
        istringstream string_in(tmp);   //创建istringstream,并拷贝tmp!
        string s;
        while (string_in >> s)
        {
            string_out.push(s);
        }
    }

    while (string_out.size()>0)
    {
        if(string_out.size()>1)
            cout << string_out.top() << " ";
        else
            cout << string_out.top();
        string_out.pop();
    }

    system("pause");
    return 0;
}

你可能感兴趣的:(1009)