【C++】STL

刷題過程中用到的STL庫函數

max_element 求數組最大元素

//6.1 每日一題 1431 擁有最多糖果的孩子
vector<int> candies;
int maxCandies=*max_element(candies.begin(),candies.end());

min_element 求數組最小元素

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章