fork download
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main() {
  6. map<int, int> m1;
  7. m1.insert({2, 30});
  8. m1.insert({1, 40});
  9. m1.insert({3, 60});
  10.  
  11. int cnt1 = m1.count(1); // 1
  12. int cnt2 = m1.count(9); // 0
  13. }
  14.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty