实现以下代码中的remove_elements函数,给定一个std::map<std::string, int>对象,删除其中值为10的所有元素:
#include <iostream>
#include <map>
#include <string>
void remove_elements(std::map<std::string, int> &m) {
}
int main() {
std::map<std::string, int> m;
std::string key;
int val = 0;
while (std::cin >> key >> val) {
m[key] = val;
}
remove_elements(m);
for (const auto &ele : m) {
std::cout << ele.first << " " << ele.second << std::endl;
}
return 0;
}