# Challenge

• 08-19-2005
arjunajay
Challenge
Ok, I Just read the new challenge and some thing hit me hard(Excuse my corny literature) while trying to make sense of it(I didn't rack my brains; I directly went to the solutions page :D ) . See this output:
Code:

```input: vector = {-1, -2, -4, -5, -6}; output: 0 //Should'nt it be returning the least naegative number???```
• 08-19-2005
Brian
what
• 08-19-2005
arjunajay
...
Quote:

Originally Posted by Brian
what

what?
Idon't get you. :confused: :confused: :confused:

oops...
Please go to cprogramming.com or its 'challenges page'
If thats what you mean by what
Sorry I didn't make any sense. ;) ;)
[/edit]
• 08-19-2005
loko
Quote:

Originally Posted by arjunajay
what?
Idon't get you. :confused: :confused: :confused:

oops...
Please go to cprogramming.com or its 'challenges page'
If thats what you mean by what
Sorry I didn't make any sense. ;) ;)
[/edit]

• 08-19-2005
arjunajay
Quote:

You're kidding me >:)
My tail is on fire, and you like my sig?
• 08-19-2005
orbitz
There are several challenges on the website, give us the URL to the specific one you are asking about.
• 08-19-2005
arjunajay
...
oops again...
here it is...
sub array problem
• 08-19-2005
ssjnamek
i dont get there solution either i can get it to work just dont get there method of going about it

Code:

```double values[5]; double max = 0; for(int i = 0;i <= values[i];i++) { cin >> values[i]; if(values[i] > max) max = values[i]; } cout << "MAX: " << max << endl; return 0;```
• 08-20-2005
arjunajay
...
They are setting the sum to zero when ever they encounter a negative sum as far as I recall. I'm thinking of introducing another variable to store the least negative(or +ve) number ever enconutered to solve this.

oh..oh..
Your program finds the largest element not the sum...
[/edit]