I'm working on an exercise that the user puts in doubles one just for as long as they want and if it's the lowest so far, it tells you. If it's the highest so far, it tells you. Problem is, I can't even test the code. Compiler lets me build it with no complaints, but when I go to run it just crashes. I'm not sure what I'm doing wrong. Can someone run this for me and see if it's just my compiler set up?
I believe the problem is you can't call max_element or min_element on an empty container (which couple is at that point). You will want to calculate those values every loop not before the loop even starts.