【发布时间】:2022-01-23 16:37:54
【问题描述】:
我正在尝试找出一张看起来像这样的桌子。我有两个多图,我想将一张地图中的所有数据放在 col1 中,将另一张地图中的所有数据放在 col2 中。
Col 1 Col 2
------------------------------------------
item1 item4
item2 item9
item5 item3
item6
multimap <int, string> :: iterator col1;
for (col1 = map1.begin(); col1 != map1.end(); ++col1)
{
cout << col1->name << '\n';
}
multimap <int, string> :: iterator col2;
for (col2 = map2.begin(); col2 != map2.end(); ++col2)
{
cout << col2->name << '\n';
}
【问题讨论】:
-
您面临的主要问题是什么?您是否在格式化列或遍历不同大小的容器时遇到问题?请贴出你目前写的代码。
标签: c++11