Josif_tepe

Untitled

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