c++选择排序
void SelectSort(int datas[], int len)
{
int tem;
for (int i = 0; i < len; ++i) {
for (int j = i + 1; j < len; ++j) {
if (datas[i] > datas[j]) {
tem = datas[i];
datas[i] = datas[j];
datas[j] = tem;
}
}
}
for (int k = 0; k < len; ++k) {
std::cout << datas[k] << " " ;
}
cout << endl;
}