数组和集合 / 字典

#include <iostream>
#include <map>
using namespace std;

map<intstring>  d1 = { {1"one"} };
map<int, string>  d2 = { {2"two"} };
map<int, string>  d3 = { {3"three"} };

map<int, string>  dAll;
dAll.insert(d1.begin(), d1.end());
dAll.insert(d2.begin(), d2.end());
dAll.insert(d3.begin(), d3.end());
//dAll is {1, 'one'}; {2, 'two'}; {3, 'three'}

for (auto &[k, v] : dAll) {
    cout << "{" << k << ", '" << v << "'}; ";
}