#include <iostream>
#include <iterator>
#include <algorithm>
#include <random>
#include <vector>
using namespace std;
int main() {
const size_t size = 10;
const float f_lowLimit = 1.0;
const float f_hiLimit = 2.0;
mt19937 gen {std::random_device()()};
uniform_real_distribution<> dis(f_lowLimit, f_hiLimit);
vector<float> v(size);
generate(v.begin(),v.end(),[&] {return dis(gen);});
copy(v.begin(), v.end(), ostream_iterator<float>(cout, " "));
auto[v_min,v_max] = minmax_element(v.begin(), v.end());
cout << endl << "min:" << *v_min << endl << "max:"<< *v_max << endl;
swap(*v_min,*v_max);
copy(v.begin(), v.end(), ostream_iterator<float>(cout, " "));
return 0;
}