CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AssocArrays
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
|
||||
Dictionary<string,int> assocArray = new Dictionary<string,int>();
|
||||
|
||||
assocArray["Hello"] = 1;
|
||||
assocArray.Add("World", 2);
|
||||
assocArray["!"] = 3;
|
||||
|
||||
foreach (KeyValuePair<string, int> kvp in assocArray)
|
||||
{
|
||||
Console.WriteLine(kvp.Key + " : " + kvp.Value);
|
||||
}
|
||||
|
||||
foreach (string key in assocArray.Keys)
|
||||
{
|
||||
Console.WriteLine(key);
|
||||
}
|
||||
|
||||
foreach (int val in assocArray.Values)
|
||||
{
|
||||
Console.WriteLine(val.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue