返回一个整数数组中最大子数组的和

设计思想 首先确定生成数值的范围,然后生成随机数存入数组,用两个for循环来检测子数组的和,定义一个变量保存最大子数组的和。 源程序代码   #include <iostream> #include <cstdlib> #include <ctime> using namespace std;   void main() {      int a[20],b,c,d=0,i,j,k,t=-100,
相关文章
相关标签/搜索