Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <list>
- #include <iterator>
- using namespace std;
- int main() {
- list<string> mylist;
- cout << "Dntry in the list is not yet empty\nDrive elements through the center\n--- == break\n\n";
- string st;
- cin >> st;
- mylist.push_back(st);
- while (1){
- cin >> st;
- if(st == "---"){
- break;
- }
- mylist.push_back(st);
- }
- cout << "End\n\n";
- mylist.reverse();
- copy (mylist.begin(), mylist.end(), ostream_iterator<string>(cout," "));
- }
Advertisement
Add Comment
Please, Sign In to add comment