#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
vector<int> a = {1,5,6,7,8,3};
cout << *min_element(a.begin(), a.end());
return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
std::vector<int> v = {2, 1, 3, 6, 7, 9, 8};
int max = *max_element(v.begin(), v.end());
int min = *min_element(v.begin(), v.end());
std::cout << min << ", " << max << std::endl; // 1, 9
return 0;
}