Josif_tepe

Untitled

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