[c++] Find largest and smallest number in an array