Advertisement
Guest User

c

a guest
Sep 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. int sumaSubMax1 (int v[], int n){
  2. int sumaMax = 0;
  3. for (int i=0; i < n ;i++){
  4. int estaSuma = 0;
  5. for (int j=i; j < n ;j++ ){
  6. estaSuma += v[j];
  7. if (estaSuma > sumaMax){
  8. sumaMax = estaSuma;
  9. }
  10.  
  11. }
  12.  
  13. }
  14. return sumaMax;
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement