int[] arrInt; arrInt = new int[]{1,2,3,45,6,8,9}; var r1 = arrInt.All(m => m > 10);// 全部元素都知足條件,false var r2 = arrInt.Any(m => m > 10);// 有任一元素知足條件,true int[] numbers1 = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var query1 = numbers1.Aggregate((a, b) => a * b); // 聚合函數,返回結果作參數,等於((((((((1*2)*3)*4)*5)*6)*7)*8)*9) var list = Enumerable.Range(1, 100); var result = list.Aggregate((a, b) => (a + b)); // 返回1+...+100的和 var nums = Enumerable.Range(2, 4); var sum = nums.Aggregate(1,(a, b) => a * b);// 2=>5的階乘