Josif_tepe

Untitled

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