110,567
社区成员
发帖
与我相关
我的任务
分享
int[] intJhao = Array.ConvertAll<string, int>(Jhao, s => int.Parse(s));
//var group = intJhao.GroupBy(i => i).Where(g => g.Count() > 1).Select (g => g.Key,g=>g.Count());
var res = from i in intJhao
group i
by i into g
where g.Count() > 1
select g;
foreach (var item in res)
{
switch (item.Key)
{
case 0:
cp.RepeatZero = item.Key;
break;
case 1:
cp.RepeatOne = item.Key;
break;
}
}