Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <fstream>
  4. #include <iomanip>
  5. #include <string>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. ifstream f("in.txt");
  12. ofstream g("out.txt");
  13. vector<string> v;
  14. string a;
  15. while (getline(f, a))
  16. v.push_back(a);
  17. while (!v.empty())
  18. {
  19. g << v.back() << "\n";
  20. v.pop_back();
  21. }
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement