I can determine until 17th line. Speacially, why it works if we cut out 17th to 19th line. If you have any time, and willing to help me, I'd be appreciated, and you would help me to understand it. I'm kinda beginner to CPP. And don't want to get C from teacher's quiz.
Try removing lines 17-19 and change the 10 in the array to a 1.
I think you will find that arr[big] = 7 (correct) and arr[secondbig] = 3 (wrong, should be 5).