Josif_tepe

Untitled

Dec 3rd, 2025
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <map>
  4. #include <unordered_map>
  5. using namespace std;
  6. int main(){
  7.     ios_base::sync_with_stdio(false);
  8.    
  9.     map<int, string> m1;
  10.    
  11.     m1[5] = "P";
  12.     m1[4] = "E";
  13.     m1[3] = "D";
  14.     m1[2] = "C";
  15.     m1[1] = "B";
  16.     m1[6] = "A";
  17.    
  18.     for(pair<int, string> p: m1) {
  19.         cout << p.first << " " << p.second << endl;
  20.     }
  21.    
  22.     unordered_map<int, string> m2;
  23.     m2[5] = "P";
  24.     m2[4] = "E";
  25.     m2[3] = "D";
  26.     m2[2] = "C";
  27.     m2[1] = "B";
  28.     m2[6] = "A";
  29.     m2[9] = "dasdasdasds";
  30.     m2[10] = "xzxczdsfsa";
  31.     m2[11] = "qwqwqwq";
  32.     m2[19] = "dasdasds";
  33.     m2[25] = "dasdasd";
  34.     cout << endl;
  35.     for(pair<int, string> p: m2) {
  36.         cout << p.first << " " << p.second << endl;
  37.     }
  38.  
  39.     return 0;
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment