Advertisement
Josif_tepe

Untitled

Mar 20th, 2024
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <set>
  4. using namespace std;
  5.  
  6. int main() {
  7.    
  8.     multiset<int> ms;
  9.    
  10.     ms.insert(5);
  11.     ms.insert(2);
  12.     ms.insert(1);
  13.     ms.insert(6);
  14.    
  15.     int najmal_element = *ms.begin();
  16.     int najgolem_element = *ms.rbegin();
  17.    
  18.     cout << najmal_element << " " << najgolem_element << endl;
  19.     return 0;
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement