View Single Post
Old 08-27-2005, 08:18 PM   #9 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Quote:
I have a question, Val. In the current code, won't pairs that are both even or both odd get added to ep while pairs that that are one even and one odd be added to op? Is it supposed to be tallied this way?
YOU ARE RIGHT! I MADE A MISTAKE.
The program does what it should do but I explained it wrong!!!! OMG.

We want to know the amount of EVEN or ODD PRODUCT pairs.
So basically:
ep = even(Numbers[i] * Numbers[j])
op = odd(Numbers[i] * Numbers[j])


Thanks for pointing out this huge flaw in the postcondition. However the code remains correct. I have updated it in my original post.
Well done!
__________________
Valmont is offline   Reply With Quote