Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <map>
- #include <unordered_map>
- using namespace std;
- int main(){
- ios_base::sync_with_stdio(false);
- map<int, string> m1;
- m1[5] = "P";
- m1[4] = "E";
- m1[3] = "D";
- m1[2] = "C";
- m1[1] = "B";
- m1[6] = "A";
- for(pair<int, string> p: m1) {
- cout << p.first << " " << p.second << endl;
- }
- unordered_map<int, string> m2;
- m2[5] = "P";
- m2[4] = "E";
- m2[3] = "D";
- m2[2] = "C";
- m2[1] = "B";
- m2[6] = "A";
- m2[9] = "dasdasdasds";
- m2[10] = "xzxczdsfsa";
- m2[11] = "qwqwqwq";
- m2[19] = "dasdasds";
- m2[25] = "dasdasd";
- cout << endl;
- for(pair<int, string> p: m2) {
- cout << p.first << " " << p.second << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment