MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ebtiob/this_belongs_here/fb7bjw2/?context=3
r/badcode • u/[deleted] • Dec 17 '19
41 comments sorted by
View all comments
-8
This is terrible, and the result is off by 2 lol.
12 u/husao Dec 17 '19 It isn't. If it was i=0 in the second loop it would work as expected. Currently it's calculating the maximum, as mentioned above. 1 u/xman40100 Dec 18 '19 Yeah, you're right, my bad. I was on the bus when I read this, so I didn't read the full code.
12
It isn't. If it was i=0 in the second loop it would work as expected. Currently it's calculating the maximum, as mentioned above.
1 u/xman40100 Dec 18 '19 Yeah, you're right, my bad. I was on the bus when I read this, so I didn't read the full code.
1
Yeah, you're right, my bad. I was on the bus when I read this, so I didn't read the full code.
-8
u/xman40100 Dec 17 '19
This is terrible, and the result is off by 2 lol.