Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <list>
- #include <fstream>
- using namespace std;
- int main()
- {
- list<string> words;
- fstream in("input.txt", ios::in);
- while (in.peek() != EOF) {
- string s;
- in >> s;
- words.push_front(s);
- }
- list<string>::iterator it = words.begin();
- while (it != words.end()) {
- cout << *it << endl;
- it++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement