📄 ch1_12.cs
字号:
using System;
using System.Collections;
class CH1_12 {
public static void Main()
{
Dictionary dict = new Dictionary();
dict.Add(1, "C++");
dict.Add(2, "C");
dict.Add(3, "Ada");
dict.Add(4, "APL");
dict.Add(5, "VB");
dict.Add(6, "C#");
dict.Add(7, "Java");
dict.Add(8, "FORTRAN");
// Print out the list
Console.WriteLine("Before Deleting Anything");
foreach ( DictionaryEntry de in dict )
{
Console.WriteLine( "Entry Key {0} Value {1}", de.Key, de.Value );
}
dict.Remove( 4 );
dict.Remove( 7 );
Console.WriteLine("\nAfter Deletions");
foreach ( DictionaryEntry de in dict )
{
Console.WriteLine( "Entry Key {0} Value {1}", de.Key, de.Value );
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -