大家好,我正在尝试将我的数据从地图传输到我的测试代码对
#include <iostream>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
string command;
int resource;
map<string, int> map;
set< pair<string, int> > s;
while (std::cin >> command && command != "stop" && std::cin >> resource)
{
map[command] += resource;
}
return 0;
}
当 while 循环完成并填充地图时。如何传输数据或将其复制到该组对?
先感谢您