fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. unordered_set<int>s;
  5. s.insert(2);
  6. s.insert(5);
  7. s.insert(5);
  8. if(s.find(2)!=s.end()) cout<<"Found";
  9. else cout<<"Not found";
  10. cout<<"\n";
  11.  
  12. set<int>t;
  13. t.insert(2);
  14. t.insert(5);t.insert(5);
  15. if(t.find(2)!=t.end())cout<<"Found";
  16. else cout<<"Not found";
  17. cout<<"\n";
  18.  
  19. map<int,int>n;
  20. n[2]=1;n[5]=2;
  21. if(n.find(2)!=n.end())cout<<"Found";else cout<<"Not found";cout<<"\n";
  22. cout<<n[5];cout<<"\n";
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 5272KB
stdin
Standard input is empty
stdout
Found
Found
Found
2