C#字母排序
using System.Collections.Generic; using System.Collections; using System; namespace my178 { public class MyComparer:Comparer<int> { public override int Compare(int x, int y) { return -(x-y); } } class Program { static void Main(string[] args) { SortedSet<int> list=new SortedSet<int>(new MyComparer()); list.Add(15); list.Add(2); list.Add(25); list.Add(13); list.Add(7); list.Add(30); foreach(int x in list) { Console.WriteLine(x); } } } }