find maximum element in stack in c++