#include <iostream> #include <vector> using namespace std; int main() { vector<string> vec; string word; while(cin>>word){ vec.push_back(word); } for(auto iter=vec.rbegin();iter!=vec.rend();++iter){ cout<<*iter<<" "; } } // 64 位输出请用 printf("%lld")
#include <iostream> #include <vector> using namespace std; int main() { vector<string> vec; string word; while(cin>>word){ vec.push_back(word); } for(auto iter=vec.rbegin();iter!=vec.rend();++iter){ cout<<*iter<<" "; } } // 64 位输出请用 printf("%lld")