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