Josif_tepe

Untitled

Aug 21st, 2025
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 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.    
  14.     list<int>::iterator it = find(l1.begin(), l1.end(), 10);
  15.    
  16.     if(it != l1.end()) {
  17.         cout << *it << endl;
  18.     }
  19.     else {
  20.         cout << "Elementot ne postoi" << endl;
  21.     }
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment