问题描述:求“-2,11,-4,13,-5,-2”的最大子序列和。
解法一:穷举法,利用3层for循环嵌套,代码如下:
解法二:利用两层for循环嵌套,代码如下:
解法三:利用分治策略进行求解,代码如下: