原因
缺少包含:using System.Collections.Generic;
代码
public class Cost
{
public double cost;
public int id;
}
public class CostComparer : IComparer<Cost>
{
public int Compare(Cost x, Cost y)
{
if (x.cost - y.cost < 1e-10)
{
return -1;
}
else
{
return 1;
}
}
}
原文地址:http://fengyuzaitu.blog.51cto.com/5218690/1902988