Josif_tepe

Untitled

Aug 21st, 2025
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <list>
  3. using namespace std;
  4.  
  5. int main() {
  6.     list<int> l1;
  7.     l1.push_front(1);
  8.     l1.push_front(2);
  9.     l1.push_front(3);
  10.     l1.push_back(4);
  11.     l1.push_back(5);
  12.    
  13.     for(list<int>::iterator it = l1.begin(); it != l1.end(); it++) {
  14.         cout << *it << endl;
  15.     }
  16.     return 0;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment