匿名類別+集合

  • 367
  • 0

摘要:匿名類別+集合

複習一下匿名類別+集合

http://msdn.microsoft.com/zh-tw/library/bb397696.aspx

var grades = new []{ new { a = 10, b = 78 }, new { a = 11, b = 92 }, new { a = 12, b = 100 }, new { a = 13, b = 37 }, new { a = 14, b = 81 } };

double average = grades.Average(g => { return g.b;});

MessageBox.Show(string.Format("The average grade is {0}.", average));

============ 以下是簽名檔 ============

一個小小螺絲釘。

第一次建立Blog,希望以後能慢慢充實它。

Howard