Josif_tepe

Untitled

May 15th, 2026
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3. using namespace std;
  4.  
  5. int main() {
  6.    
  7.     map<int, string> m1;
  8.  
  9.     map<int, string> m2 = {{1, "Geeks"},
  10.               {2, "For"}, {3, "Geeks"}};
  11.    
  12.     map<int, string> m3;
  13.     m3[0] = "c";
  14.     m3[1] = "+";
  15.     m3[2] = "+";
  16.    
  17.  
  18.     for (auto p : m2)
  19.         cout << p.first << " " << p.second << endl;
  20.    
  21.     cout << m2[1] << endl;
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment