题目链接:https://leetcode-cn.com/problems/maximum-ascending-subarray-sum/
题目如下:
class Solution {
public int maxAscendingSum(int[] nums) {
int i,sum=nums[0],max=nums[0];
for(i=1;i<nums.length;i++){
if(nums[i]>nums[i-1]) sum+=nums[i];
else {
if(sum>max) max=sum;
sum=nums[i];
}
}
if(sum>max) max=sum;
return max;
}
}