Advertisement
sajid161

9:3

Jan 6th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. set<int> setInsert(int arr[],int n)
  2. {
  3.     set<int>s;
  4.    
  5.       for(int i=0;i<n;i++)
  6.     {
  7.         s.insert(arr[i]);
  8.     }
  9.    
  10.    
  11.     return s;
  12.    
  13. }
  14.  
  15.  
  16. void setDisplay(set<int>s)
  17. {
  18.      for(auto u:s) cout<<u<<" ";
  19.    
  20.     cout<<endl;
  21. }
  22.  
  23.  
  24. void setErase(set<int>&s,int x)
  25. {
  26.    if(s.erase(x))
  27.     cout<<"erased "<<x;
  28.    
  29.     else
  30.     cout<<"not found";
  31.    
  32.    
  33.     cout<<endl;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement