Try using \n instead of endl.
but this program can not run, some bugs occurred...
how to fixed it, or how to rebuild it?
Edit your post so we can see all the code, so we can build it... Or tell us the line where the error is...
Tell us what the error is.
Sorry for the late reply.
on the above coding, if i input the value like -> 1 2 3 4 5 6 7...
the expected result should be
Second min = 2, Maximum = 7.. but my result is Second min = 1, Maximum = 7... its wrong!!
however, if i input -> 7 6 5 4 3 2 1 .. i will get the right result.. how to change of my program? thanks
1. Tracking min is totally unrelated to tracking max.
2. What should the second* be, if input has only one value?
3. What should the secondmin be, if input is: 1, 5, 1?
4. When max changes, what do we know about the previous value of max?
5. When max does not change, what is the relation of the new value and secondmax?