//缘由https://bbs.csdn.net/topics/395608543?page=1#post-410386348
int[] aa = new int[9] { 44, 4, 77, 7, 33, 3, 9, 9, 66 };
Console.WriteLine("原数组: {0}", string.Join(",", aa));
aa = aa.OrderByDescending(a => a).Distinct().ToArray();
var aaa = (aa.ToList().IndexOf(9, 0) + 1).ToString();
Console.WriteLine("排序去重数组: {0}", string.Join(",", aa));
Console.WriteLine("求在数组中的排位: {0}", aaa);
C#求在数组中的排位
最新推荐文章于 2024-08-14 13:44:32 发布