Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Appendme
Created October 25, 2018 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Appendme/3065000f54f829a9a6fd74272402599b to your computer and use it in GitHub Desktop.
Save Appendme/3065000f54f829a9a6fd74272402599b to your computer and use it in GitHub Desktop.
#include <iostream>
#include <fstream>
#include <vector>
int main()
{
std::ifstream input("input.txt");
std::vector<std::string> strings;
std::string temp;
while (input >> temp)
{
strings.push_back(temp);
}
while (strings.size())
{
std:: cout << strings.back() << " ";
strings.pop_back();
}
std::cout << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment