c++ max and min of vector

#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    std::vector<int> numbers = {4, 2, 7, 1, 9, 5};

    // Finding the maximum element in the vector
    int max_element = *std::max_element(numbers.begin(), numbers.end());

    // Finding the minimum element in the vector
    int min_element = *std::min_element(numbers.begin(), numbers.end());

    // Output the results
    std::cout << "Maximum element: " << max_element << std::endl;
    std::cout << "Minimum element: " << min_element << std::endl;

    return 0;
}