北邮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; } } }