赞
踩
using System.Text;
using System.Collections.Generic;
using System.Collections;
using System;
namespace my178A
{
public class MyComparer:Comparer<string> { public override int Compare(string x, string y) { return (short)((Encoding.ASCII.GetBytes(x))[0])-(short)((Encoding.ASCII.GetBytes(y))[0]); } } class Program { static void Main(string[] args) { SortedSet<string> list=new SortedSet<string>(new MyComparer()); list.Add("D"); list.Add("C"); list.Add("B"); list.Add("G"); list.Add("F"); foreach(string x in list) { Console.WriteLine(x); } } }
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。