编辑代码

using System;
using System.Collections.Generic; 
using System.Linq;

public class HelloWorld
{
    public static void Main()
    {
        //数据结构
        //Array
        int[] a = {10, 20, 30, 40};
        Console.WriteLine(a[1]);

        //List
        List<int> nums = new List<int>();

        Console.WriteLine("Count:" + nums.Count);

        nums.Add(11);
        nums.Add(22);
        nums.Add(56);
        nums.Add(6);

        Console.WriteLine("Count:" + nums.Count);

        nums.RemoveAt(2);
        nums.Insert(2, 23);

        foreach(int n in nums){
            Console.WriteLine(n);
        }

        //Dictionary
        Dictionary<string, int> ages = new Dictionary<string, int>();
        ages["曾方洲"] = 11;
        ages["曾羿阳"] = 23;

        Console.WriteLine("年龄:" + ages["曾方洲"]);

        //key, value
        Dictionary<int, string> strings = new Dictionary<int, string>();
        strings[11] = "apple";
        Console.WriteLine(strings.ContainsKey(11));

        strings.Remove(11);

        Console.WriteLine(strings.ContainsKey(11));
    }
}