Guest User

Untitled

a guest
Jul 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3. #include <vector>
  4.  
  5. int main()
  6. {
  7.     using namespace std;
  8.  
  9.     map<vector<int>, string> dictionary;
  10.  
  11.     vector<int> vector1 = { 1, 2, 3 };
  12.  
  13.     dictionary.insert(pair<vector<int>, string>(vector1, "vector1"));
  14.     dictionary.insert(pair<vector<int>, string>(vector1, "vector2"));
  15.  
  16.     map<vector<int>, string>::iterator it = dictionary.begin();
  17.     for (it = dictionary.begin(); it != dictionary.end(); ++it)
  18.     {
  19.         cout << " value " << it->second << '\n';
  20.     }
  21.    
  22.     return EXIT_SUCCESS;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment