Kvíz: Počítání kořisti
#include <iostream>
#include <map>
#include <string>
int main() {
std::map<std::string, int> korist = {{"lektvar", 1}, {"drahokam", 2}};
korist["drahokam"] += 3;
korist["chleba"]++;
std::cout << korist["helma"] << std::endl;
for (const auto& [predmet, pocet] : korist) {
std::cout << predmet << ": " << pocet << std::endl;
}
return 0;
}