c++ vector获得最大、最小值 如题。使用max_element或min_element函数即可,举例如下: #include <vector> #include <algorithm> vector<int> beast = { 1, 1, 4,