link中sum是求和,那么什么函数能求乘积?
using System; using System.Linq; public class Test { public static void Main() { int[] arr = {2,3,4}; int result = arr.Aggregate(1, (a, b) => a*b); Console.WriteLine(result); //24 } }