I. Title: returns the and of the largest sub-array in an integer array.
two. Requirements: Enter an array of shapes, there are positive numbers in the array and there are negative values.
One or more consecutive integers in an array make up a sub-array, each of which has a and.
The maximum value for the and of all sub-arrays. Requires a time complexity of O (n).
three. Pair programming requirements: two pairs to complete the programming task.
One person is mainly responsible for program analysis, code programming. One person is responsible for code review and Code test plan.
Publish a blog post about the process, experience, and how to resolve conflicts between two people (attach a work photo of the development).
Four. Team member: Kong Weichun, Cui Peng
Five. Cooperation Process and experience:
I and Tripenberg two people take charge of the procedure, analysis Code programming and code review, code test, strengthen the cooperative programming ability, have a great promotion to oneself, when conflict, first through mutual exchange views to seek common ground, and then from the online access to data or actual programming, choose the most appropriate method, ideas.
Six. SOURCE program code
ConsoleApplication3.cpp: Defines the entry point of the console application.
#include "stdafx.h"
int _tmain (int argc, _tchar* argv[])
{
return 0;
}
#include <iostream>
using namespace Std;
#include <stdlib.h>
#include <time.h>
int main ()
{
int i;
int a[10];
int max = 0;
int b = 0;
Srand (Time (NULL));
cout << "array is:";
for (i = 0; i<10; i++)
{
A[i] = rand ()% 201-100; Randomly generated-integers from 10 to 10
}
for (i = 0; i<10; i++)
{
cout << A[i] << "";
}
cout << Endl;
for (i = 0; i <; i++)
{
B + = A[i];
if (b < 0)
b = 0;
if (b > Max)
max = b;
}
if (max = = 0)
{
max = a[0];
for (i = 0; i <; i++)
{
if (Max < a[i])
{
max = A[i];
}
}
}
cout << "Maximum sub-array:" << max << Endl;
System ("pause");
return 0;
}
Seven. Results
Trooped Programming Summary