会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
博客呀
博客园
首页
新随笔
联系
管理
订阅
2018年10月14日
求一个整数数组中最大子数组的和。
摘要: 遍历一遍,找连续的正数求和,同时比较求和的大小,最后输出最大的和就可以。 源代码: #include <iostream>#include<time.h>using namespace std;int maxSum(int*a,int n){ int sum=0; int b=0; for(int
阅读全文
posted @ 2018-10-14 18:15 博客呀
阅读(251)
评论(0)
推荐(0)
编辑
公告