fork(13) download
  1. #include<iostream>
  2. #include<algorithm>
  3. #include<vector>
  4. #include<string>
  5.  
  6. using namespace std;
  7.  
  8. int main(){
  9. string s;
  10. vector<string> v;
  11. while(cin>>s){
  12. v.push_back(s);
  13. }
  14. reverse(v.begin(), v.end());
  15. for(vector<string>::iterator it= v.begin(); it!=v.end(); it++){
  16. cout<<*it<<" ";
  17. }
  18. cout<<endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 3480KB
stdin
i mean you are an asshole
stdout
asshole an are you mean i