1// map::at
2#include <iostream>
3#include <string>
4#include <map>
5
6int main ()
7{
8 std::map<std::string,int> mymap = {
9 { "alpha", 0 },
10 { "beta", 0 },
11 { "gamma", 0 } };
12
13 mymap.at("alpha") = 10;
14 mymap.at("beta") = 20;
15 mymap.at("gamma") = 30;
16
17 for (auto& x: mymap) {
18 std::cout << x.first << ": " << x.second << '\n';
19 }
20
21 return 0;
22}