Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3. #include <list>
  4.  
  5. using namespace std;
  6.  
  7. typedef list<string> LIST_STR;
  8.  
  9. int main()
  10. {      
  11.  
  12.     list<LIST_STR> ls;
  13.    
  14.     ls.emplace_back();
  15.     ls.emplace_back();
  16.     ls.emplace_back();
  17.  
  18.     for (auto &x: ls) {
  19.         x.push_back("Hello ");
  20.         x.push_back("world");
  21.         x.push_back("!\n");
  22.     }
  23.  
  24.     for (auto &x: ls) {
  25.         for (auto &xs: x) {
  26.             cout << xs;
  27.         }
  28.     }
  29.    
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement