Aggregate

            int[] agg = new int[] { 10, 2,3,4,5,6,7,8 };
            int[] s = { 1, 2, 3, 4, 45 };
            //  计算和     seed 这里对应 0 ,为x 的初始值
            var ss = agg.Aggregate(0,(x, y) =>
            {
                Console.WriteLine($"x:{x}y:{y}");
                x = y+x;
                return x;  //  每次会将 retuen的值,赋值给x 进行下一次循环
            }
            );
原文地址:https://www.cnblogs.com/hnzheng/p/12768520.html