日期:2014-05-18 浏览次数:20836 次
var totalgroup= list.GroupBy(c => c.LeaveTime.Month).OrderBy(c=>c.Key); foreach (var item in totalgroup) { Console.WriteLine(item.Key+"月出院的人有:"); foreach (var item2 in item) { Console.WriteLine("病人:"+item2.Name+"\t出院时间:"+item2.LeaveTime); } }