Josif_tepe

Untitled

May 15th, 2026
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main() {
  6.     map<int, string> m = {{1, "Geeks"},
  7.              {2, "For"}, {3, "Geeks"}};
  8.  
  9.     auto it = m.find(0);
  10.     //map<int, string>::iterator it = m.find(0);
  11.  
  12.     if (it != m.end())
  13.         cout << it->first << " " << it->second;
  14.     else cout << "Key not Found!";
  15.     return 0;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment