150330 of software Testing

Source: Internet
Author: User

This test chooses the Douxiaoson code, I own in 25w element when already hangs. int max support to million bit ...

//Xiaosong Du 2015/3/22#include <iostream>#include<time.h>using namespacestd;#defineN 1000voidMain () {intA[n],d =0, D1 =0; intMaxd, Maxd1,end1 =0, end2=0; Srand ((unsignedint) Time (0));  for(inti =0; I < n;i++) {A[i]= rand ()% -- -; cout<< A[i] <<" "; } cout<<Endl; Maxd= a[0];  for(inti =0; I < n;i++) {D+=A[i]; if(D >Maxd) {Maxd=D; End1=i; }        if(D <0) {D=0; }} maxd1= f[i-1];  for(inti = n1; I >=0; i--) {D1+=A[i]; if(D1 >maxd1) {Maxd1=D1; End2=i; }        if(D1 <0) {D1=0; }} cout<<"the sub-arrays are:";  for(inti = End2;i <= end1;i++) cout<< A[i] <<" "; cout<<Endl; cout<<"and for:"<< Maxd <<Endl; }

Results:

Teammate cooperation:

150330 of software Testing

Related Article

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.