View Problem

Define an initial map

Define the map {circle:1, triangle:3, square:4}
ExpandDiskEdit
cpp C++/CLI .NET 2.0
Hashtable^ shapes = gcnew Hashtable;

shapes->Add("circle", 1);
shapes->Add("triangle", 3);
shapes->Add("square", 4);
ExpandDiskEdit
cpp C++/CLI .NET 2.0
Generic::Dictionary<String^, int>^ shapes = gcnew Generic::Dictionary<String^, int>();

shapes->Add("circle", 1);
shapes->Add("triangle", 3);
shapes->Add("square", 4);
ExpandDiskEdit
cpp
map<string, int> shapes;

shapes["circle"] = 1;
shapes["triangle"] = 3;
shapes["square"] = 4;
ExpandDiskEdit
fantom
map := ["circle":1, "triangle":2, "square":4]

Submit a new solution for cpp, csharp, or fantom
There are 29 other solutions in additional languages (clojure, erlang, fsharp, go ...)