#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;
template<class Iter>
void selectSort(const Iter &begin, const Iter &end) {
for (auto head = begin; head != end - 1; head++) {
auto temp = head;
for (auto i = head; i != end; i++) {
if (*i < *temp) {
temp = i;
}
}
swap(*head, *temp);
}
}
int main() {
vector<int> arr{ 1,25,33,7,5,774,52,45 };
selectSort(arr.begin(), arr.end());
for (auto i = arr.begin(); i != arr.end(); i++) {
cout << *i << " ";
}
sort(arr.begin(), arr.end());
cout << endl;
system("pause");
return 0;
}