// Demonstrates at()
#include <iostream>
#include <string>
#include <unordered_map>
int main ()
{
//Initializing a map with values
std::unordered_map<std::string,int> mymap = {
{ "First", 100},
{ "Second", 200},
{ "Third", 300 }
};
//Updating values with the help of at() method
mymap.at("First") = 50;
mymap.at("Second") += 500;
mymap.at("Third") = mymap.at("First") + 950;
//Printing all three values
for (auto& x: mymap) {
std::cout << x.first << ": " << x.second << std::endl;
}
return 0;
g++