摘要:
#include#include#include#includestruct link{ int data; struct link *next;};void delMiddle(link *head){ if(head == NULL) return; else if(head->next == NULL) { delete head; return; } else { link *low = head; link *fast = hea... 阅读全文
摘要:
#includeint max(int a,int b){ return (a>b?a:b);}int findBiggestSum(int *B,int k){ int m=0,n;//m存储:到B[i[结束的最大子数组和 //n存储B[i]之前的最大数组和,可能包括B[i],也可能不包括 int i; n=B[0]; for(i=1;i<k;i++) { m=max(B[i],m+B[i]); n=max(n,m); } return n;}int main(){ int A[10]={2,4,-9,4,8,7,-3,-7,6,3}; int sum; sum=findBigg 阅读全文