PAT basic 1009

来源:互联网 发布:新南威尔士奖学金知乎 编辑:程序博客网 时间:2024/06/14 18:41
#include<iostream>#include<stack>using namespace std;int main(){    stack<string> v;    string s;    while(cin >> s)    {        v.push(s);    }    cout << v.top();    v.pop();    while(!v.empty())    {        cout << " " << v.top();        v.pop();    }    return 0;}
原创粉丝点击