#include <iostream>
#include <unordered_map>
int main() {
std::unordered_map<std::string, int> ageMap;
// Insertion
ageMap["Alice"] = 30;
ageMap["Bob"] = 25;
ageMap["Charlie"] = 35;
// Accessing elements
std::cout << "Alice's age: " << ageMap["Alice"] << std::endl;
// Lookup
if (ageMap.find("Bob") != ageMap.end()) {
std::cout << "Bob is in the map." << std::endl;
}
// Deletion
ageMap.erase("Charlie");
// Iterating over the map
std::cout << "People in ageMap:" << std::endl;
for (const auto& pair : ageMap) {
std::cout << pair.first << ": " << pair.second << std::endl;
}
return 0;
}