ChemComparer.cs 414 B

1234567891011121314151617
  1. using System.Collections.Generic;
  2. namespace Core.StlMes.Client.Judge.Commons
  3. {
  4. /// <summary>
  5. /// 按照字符串长度比较大小
  6. /// </summary>
  7. class ChemComparer : IComparer<string>
  8. {
  9. public int Compare(string x, string y)
  10. {
  11. if (x.Length == y.Length) return 0;
  12. else if (x.Length < y.Length) return -1;
  13. else return 1;
  14. }
  15. }
  16. }