北邮OJ 反转单词

#include <bits/stdc++.h>
using namespace std;
int main(){
string ss;
stack <string>s;
while(cin>>ss){
s.push(ss);
if(cin.get()=='\n'){
while(1){
ss=s.top();
s.pop();
cout<<ss;
if(s.empty())
break;
else
cout<<" ";
}
cout<<endl;
}
}
}
版权声明:本文为bingkuoluo_原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。