|
------------------------------------------------------------- int
MaxSubsequenceSum( const int A[ ], int N
) {
int ThisSum,
MaxSum, j; ThisSum
= MaxSum = 0;
for( j = 0;
j < n; j++ ) ¨ç
{
ThisSum += A[ j
]; ¨è if(
ThisSum > MaxSum ) MaxSum = ThisSum; ¨é else
if( ThisSum < 0 ) ThisSum
= 0; } ¨ê
return
MaxSum; } -------------------------------------------------------------
|
|