Josif_tepe

Untitled

Oct 1st, 2025
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <set>
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.    
  8.     set<int> s;
  9.    
  10.     int n;
  11.     cin >> n;
  12.    
  13.    
  14.     for(int i = 0; i < n; i++) {
  15.         int x;
  16.         cin >> x;
  17.        
  18.         s.insert(x);
  19.     }
  20.    
  21.     int m;
  22.     cin >> m;
  23.    
  24.     for(int i = 0; i < m; i++) {
  25.         int x;
  26.         cin >> x;
  27.        
  28.         set<int>::iterator it = s.find(x);
  29.         if(it == s.end()) {
  30.             cout << "Elementot " << x << " ne postoi" << endl;
  31.         }
  32.     }
  33.    
  34.     return 0;
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment