fork(1) download
  1. #include<iostream>
  2. #include<set>
  3.  
  4. int main(){
  5. // Create a set object holding integers
  6. std::set<int> mySet {1,2,3,4,-5};
  7. if(mySet.count(1)!=0){
  8. std::cout << "1 : is not an element of myset" << std::endl;
  9. }else{
  10. std::cout << "1 : is a element of mySet" << std::endl;
  11. }
  12. if(mySet.count(12)!=0){
  13. std::cout << "12 : is not an element of myset" << std::endl;
  14. }else{
  15. std::cout << "12 : is a element of mySet" << std::endl;
  16. }
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 4528KB
stdin
Standard input is empty
stdout
1 : is not an element of myset
12 : is a element of mySet