All pastes #985927 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-04-15 12:28 UTC
rendered paste body
        public int maxSegemntsum(int[] tal) {
            int thisSum = 0;
            int maxSum = 0;
            for (int i = 0; i < tal.Length; i++) {
                thisSum = Math.Max(thisSum + tal[i], tal[i]);
                maxSum = Math.Max(thisSum, maxSum);
            }
            return maxSum;
        }