Josif_tepe

Untitled

May 15th, 2026
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <list>
  3. using namespace std;
  4.  
  5. int main(){
  6.     list<int> myList;
  7.  
  8.     myList.push_back(10);
  9.     myList.push_back(20);
  10.     myList.push_front(5);
  11.    
  12.  
  13.     cout << "List elements: ";
  14.     for (int x : myList){
  15.         cout << x << " ";
  16.     }
  17.     cout << endl;
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment