fork download
  1. #include<iostream>
  2. #include<fstream>
  3. #include<vector>
  4. #include <iterator>
  5. #include <algorithm>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. //ifstream cin("input.txt");
  12. //ofstream cout("output.txt");
  13. vector<string> v;
  14. long long int a,b,i,j;
  15. string str;
  16. while(getline(cin,str))
  17. {
  18. v.push_back(str);
  19. }
  20.  
  21. for (vector<string>::const_reverse_iterator it = v.rbegin(); it != v.rend(); ++it) {
  22. reverse_copy(it->begin(), it->end(), ostream_iterator<char>(cout));
  23. cout << endl;
  24. }
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 2992KB
stdin
Beautiful
Explicit
Simple
Complex
stdout
xelpmoC
elpmiS
ticilpxE
lufituaeB