网站介绍:文章浏览阅读5.8k次,点赞3次,收藏18次。c++中的数组或vector取最大、最小值以及对应索引1.数组的最大、最小以及对应的下标索引int card[6]={1,2,3,4,5,6}最大值:int maxValue = *max_element(card.begin(),card.end());最小值:int minValue = *min_element(card.begin(),card.end());最大值下标索引:int maxPosition = max_element(card,card+6) - card; 最小值下标索_c++ vector 最大值
- 链接地址:https://wobushixiaohai.blog.csdn.net/article/details/124866434#comments_23477001
- 链接标题:c++中的数组或vector取最大、最小值以及对应索引_c++ vector 最大值_不脱发的码农~~~~的博客-CSDN博客
- 所属网站:wobushixiaohai.blog.csdn.net
- 被收藏次数:9341
- 网站标签:c++ vector 最大值