minmax_element

头文件:

1.#include<algorithm>

2.功能:能找出最大值和最小值

3.使用方法:

 minmax_element(m1.begin(),m1.end());

 cout << "min: " << *(m1.first) << endl;
    cout << "max:  " << *(m1.second) << endl;

猜你喜欢

转载自www.cnblogs.com/miao-xixixi/p/12590374.html