Josif_tepe

Untitled

May 9th, 2026
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <set>
  3. using namespace std;
  4. int main() {
  5.    
  6.     set<int> st;
  7.    
  8.     st.insert(5);
  9.     st.insert(4);
  10.     st.insert(9);
  11.     st.insert(5);
  12.    
  13.     for(set<int>::iterator it = st.begin(); it != st.end(); it++) {
  14.         cout << *it << " ";
  15.     }
  16.     cout << endl;
  17.    
  18.     for(int x: st) {
  19.         cout << x << " " ;
  20.     }
  21.     cout << endl;
  22.    
  23.     return 0;
  24. }
  25.  
  26.  
  27.  
Advertisement
Add Comment
Please, Sign In to add comment