minmax_element

头文件:

1.#include<algorithm>

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

3.使用方法:

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

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

posted @ 2020-03-29 00:07  miao-xixixi  阅读(625)  评论(0编辑  收藏  举报