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