The sum of the largest sub-arrays of the 32-D array of team development projects

Source: Internet
Author: User

The sum of the largest sub-arrays of the 32-D array of team development projects

Design idea: The sum of each sub-matrix in each case in which the order of the column or row is computed in the order of the column or row, then the sum of each sub-matrix is compared, and the largest one is the sum of the maximum number of words;

Source:

//The sum of the maximal sub-arrays of two-dimensional arrays//Li min, Apr 8th#include <iostream>#include<time.h>using namespacestd;voidMain () {intm,n,a[ -][ -],k,t,c,i,j,z; intmaxsum,sum[ -],max=0; cout<<"Please enter the number of rows and columns of the matrix:"<<Endl; CIN>>m>>N;    Srand ((unsigned) time (NULL));  for(i=0; i<m;i++)     {             for(j=0; j<n;j++) {A[i][j]= rand ()% $- -; cout<<a[i][j]<<" "; } cout<<Endl; }         for(k=0; k<m;k++)        {            //Initializes a two-dimensional array of type m*n to serve as the sum of the sub-matrices for each refinement of the reserve             for(c=0; c<n;c++) {Sum[c]=0;} //the sum of each sub-matrix obtained by this matrix Division             for(j=k;j<n;j++)            {                 for(i=0; i<m;i++) {Sum[i]+=A[i][j]; }                //The sum of the maximal sub-matrices of each sub-matrix obtained is compared in turn.                    for(t=0; t<m;t++) {maxsum=0;  for(z=t;z<n;z++) {maxsum+=Sum[z]; if(maxsum>max) Max=maxsum; } }}} cout<<"The sum of the maximum sub-matrices is:"<<Max; }

Experiment:

Cooperation Process and experience: This is another process of our cooperation, I think we have gradually integrated into the process, which we can work together to learn from each other, which is faster than a person to write the program, which can improve the efficiency of writing programs, of course, conflict is inevitable, When we are in conflict, we will calm down and carefully consider ourselves and the other person's thinking or move on to other things, and then feel that we can work, and then continue with the consistent goal of our development.

Team Development member: Li min Liu Zixiang

Work Photo:

The sum of the largest sub-arrays of the 32-D array of team development projects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.