4,818
社区成员
发帖
与我相关
我的任务
分享int[] data = { 998, 997, 998, 132, 123, 145, 106, 144, 452, 497, 105, 116, 144, 154, 145, 144, 670, 112, 671, 667, 749, 105, 321, 998, 996, 998, 977, 998, 901, 854, 154, 389, 798, 501, ... };
var query = data.OrderBy(x => x).Select(x => new { v = x.Key, c = x.Count() }).OrderBy(x => x.c).Select(x => x.v.ToString() + "(" + x.c.ToString() + ")");
foreach (string item in result)
{
Console.WriteLine(item);
}