C++里面是这样的:typedef std::unordered_map<std::string,std::string> stringmap;
std::unordered_map<std::string,double>::const_iterator got = mymap.find (input);
std::pair<std::string,double> myshopping ("baking powder",0.3);
myrecipe.insert (myshopping);
Java是这样的:
Map<Character, Integer> map = new HashMap<Character, Integer>();
map.containsKey(c)
map.put(c, 1);
int x = map.get(temp);
时间: 2024-10-26 01:09:26