对int数组进行从大到小的排序,并去除重复项

static void Main(string[] args)
{
int[] xx = { 1, 4, 4, 4, 6, 6, 8, 76, 7, 4 };
List
<int> l = xx.ToList<int>();
l.Sort();

var query
= (from q in l
select q).Distinct();

for (int i = query.Count() - 1; i > 0; i--)
{
Console.Write(query.ElementAt(i)
+ " , ");
}

Console.Read();
}
posted @ 2011-07-10 13:29  炒米饭  阅读(364)  评论(0编辑  收藏  举报