17,074,230 third operation

The third operation

First, the format requirements

Work requirements https://edu.cnblogs.com/campus/jssf/infor_computation17-31/homework/10454
My aim in this course is Learn to independently develop simple software, simple fix some vulnerabilities
This job helped me in terms of what specific goals Independent write the code to solve the problems encountered
Other references https://www.jianshu.com/p/ebe52d2d468f
Text of the job https://i-beta.cnblogs.com/posts/edit

Second, this work

unit test

And the largest array of sub-arrays.

  • With a class / function to implement
  • Requirements: want to return three kinds of information
  1. The largest sub-arrays and
  2. The largest sub-array starting index
  3. The largest sub-end of the array subscript
  • Reading input data from a text file, the file operation familiar, there are two data files
  1. The first number: the number of the test data, a colon after the number.
  2. Subsequent digits: for each value of data separated by commas
  • Such as file content:
    17: -32, -10, 33, -23, 32, -12, 41, -12, 1, 3, 5, -98, 70, -21, 10, -9, 61
    output
    sum = 71

Third, the blog work

In the three years of study, the main areas of study are on the computer language c ++, Java, databases, data structures, operating systems, MATLAB computing, but only to master some basic theoretical knowledge, wrote the code for this one also there are a lot of lack of bug fixes but also for the lack of a lot of experience, I think the most important thing is learning attitude and approach, each piece will not, but have everything to learn, should focus on understanding the needs of the market analysis, insight and industry to improve project management skills, know how to self-manage.
About the future: I want to learn after the computing and software engineering this course can before what they learn with this course together, learn this course under the teacher's help and their own efforts to understand the market demand and energy with students to develop some simple software development, more efficient repair bug, exercise their thinking ability.

Four, preview

  • Code specification and code review
    to write code to develop good habits, including qualified indentation, line width, brackets, branches, name, underscores and capitalization issues, and comment, because the code with the progress of science and technology has gradually become complex, a team to complete a large software engineering must review other players, there is a good habit to write code, will improve development efficiency.
    Development review include: design review, code review, test plan review, document review.
    Purpose of the review is to:
    (1) identify the error code. Such as:

a. coding errors, such as some can happen to fool the compiler error.

b. does not meet code specifications of the project team place.
(2) find logic errors, the program can compile, but the logic of the code is wrong.
(3) discovery algorithm errors, such as the use of the algorithm is not optimal.
(4) identify potential errors and regression errors - before the current changes resulted in repair of the defect appeared again.
(5) detect possible areas of improvement.
(6) Education (mutual education) developers, teaching experience, so that more members are familiar with the code of each part of the project, at the same time familiar and applications

V. Code

#include
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#include
using namespace std;
int maxsubset(int *a,int length){
int summax=INT_MIN;
int i,j,k;
for(i=0;i<length;i++)
for(j=i;j<length;j++){
int temp=0;
for(k=i;k<=j;k++)
temp+=a[k];
if(temp > summax)
summax=temp;
}
return summax;
}
int main(){
int a[]={-32,-10,33,-23,32,-12,41,-12,1,3,5,-98,70,-21,10,-9,61};
cout<<"最大子数组的和::"<<maxsubset(a,16)<<endl;
system("pause");
return 0;
}

Guess you like

Origin www.cnblogs.com/zhaoyaya/p/12448370.html