集合之sortlist
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace TestConsole
{
class Program
{
static void Main(string[] args)
{
SortedList sl = new SortedList();
sl["c"] = 41;
sl["b"] = 23;
sl["a"] = 12;
sl["d"] = 32;
foreach (DictionaryEntry de in sl)
{
string str = (string)de.Key;
int i = (int)de.Value;
Console.WriteLine("{0}:{1}",str,i);
}
}
}
}
//a:12
//b:23
//c:41
//d:32
//请按任意键继续. . .
写的是不难,难的是天天坚持写!