首先运行以下代码
var list = new List<int> {1, 5, 0, 65, 2, 1, 0, 10};
var ordered = list.OrderBy(i => ++i);
foreach (var i in ordered)
{
Console.WriteLine(i);
}
输出:0 0 1 1 2 5 10 65
然后,
var list = new List<int> {1, 5, 0, 65, 2, 1, 0, 10};
var ordered = list.OrderBy(i => --i);
foreach (var i in ordered)
{
Console.WriteLine(i);
}
输出:和之前一样
我的问题是为什么会这样??