Console.WriteLine("start:出自http://www.VEVb.com/ahjesus);
List<int> sourceArr = new List<int> { 99, 51, 61, 41, 8, 73, -3, 225, 3, 10, 0 };
int maxIndex = sourceArr.Max() * 10 + 1;
object[] replaceArr = new object[maxIndex];
sourceArr.ForEach(it => { replaceArr[it < 0 ? ~it * 10 : it * 10] = it; });
IEnumerable<object> result = replaceArr.Where(it => it != null);
foreach (var it in result) {
Console.WriteLine(it);
}
新闻热点
疑难解答